Commit Graph

3156 Commits

Author SHA1 Message Date
1e5c7e54ee Implement new error handling stack
This separates the error registry (mapping exception types to status
codes) from actual handling (the middleware) as well as error formatting
(Whoops, pretty error pages or JSON-API?) and reporting (log? Sentry?).

The components can be reused in different places (e.g. the API client
and the error handler middleware both need the registry to understand
all the exceptions Flarum knows how to handle), while still allowing to
change only the parts that need to change (the API stack always uses the
JSON-API formatter, and the forum stack switches between Whoops and
pretty error pages based on debug mode).

Finally, this paves the way for some planned features and extensibility:
- A console error handler can build on top of the registry.
- Extensions can register new exceptions and how to handle them.
- Extensions can change how we report exceptions (e.g. Sentry).
- We can build more pretty error pages, even different ones for
  exceptions having the same status code.
2020-02-04 22:37:24 +01:00
408043a203 Remove obsolete constructor parameter
This was removed in commit 484c6d2e.
2020-02-04 22:37:24 +01:00
9b449386d6 Bundled output for commit c5122bf5d57c07854a3c3cfce09e1547b65d6b68 [skip ci] 2020-02-04 22:37:24 +01:00
f1d9753aee a11y: Try to make screenreaders read tooltips
Refs #1835.
2020-02-04 22:37:24 +01:00
54f733ca80 Add canonical URL to discussion list (#1814) 2020-02-04 22:37:24 +01:00
a737b98e7f Bypass CSRF token check when using access tokens
Fixes #1828.
2020-02-04 22:37:24 +01:00
80546b9ed7 Make exception message dynamic as well 2020-02-04 22:37:24 +01:00
9758dfac47 Determine default route after extensions
Fixes #1819.
2020-02-04 22:37:24 +01:00
970c0f5604 PHPUnit: Get rid of deprecated annotation
Refs #1795.
2020-02-04 22:37:24 +01:00
42a7f2f586 Allows configuration of where the language files live. So that
language packs can optionally decide for themselves if they want
to use a different directory.
2020-02-04 22:37:24 +01:00
3611fa1bb9 fixes #1695, take into consideration is_private with counts on User stats 2020-02-04 22:37:24 +01:00
c881f9f633 fixed ci, make green again; mysql service wasnt booted 2020-02-04 22:37:24 +01:00
0a22a66189 Prevent MySQL search operators from taking effect
We do not want to inherit MySQL's fulltext query language, so let's
just drop all non-word characters from the search term.

Fixes #1498.
2020-02-04 22:37:24 +01:00
64b53fb0ac Revert "Remove deprecated bootstrap.php fallback"
This reverts commit f8061bbca13b0cbaea418acedc03c008bbf8edcb.

We will keep this fallback in place, to avoid unnecessary breakage of
backwards compatibility for extension authors.

Removal is planned for the final 0.1 release.
2020-02-04 22:37:24 +01:00
627724839d Clean up database query
- Use existing `selectRaw()` method to avoid using the global `app()`
  helper as a service locator, which hides dependencies.
- Do the same for the join.
- The `Expression` is necessary to prevent the aliased column from being
  prefixed with the database table prefix, if configured.
2020-02-04 22:37:24 +01:00
fa3915fa53 Bump lodash-es from 4.17.11 to 4.17.14 in /js (#1818)
Bumps [lodash-es](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-04 22:37:24 +01:00
1948b7e6f4 Apply fixes from StyleCI
[ci skip] [skip ci]
2020-02-04 21:11:08 +00:00
4465e7648b move deprecated methods to trait for cleaner code until we remove it 2020-02-04 22:10:39 +01:00
aef56c055a Apply fixes from StyleCI
[ci skip] [skip ci]
2019-11-19 11:38:56 +00:00
dd3a4173a1 noop instead of exception 2019-11-19 12:38:45 +01:00
7c204c82ab attempt to be more decisive on forcing the new user preferences 2019-11-13 14:35:42 +01:00
12fff33763 started refactoring the User class to the Notification Preference class 2019-10-28 10:27:38 +01:00
603367a41a added followAfterReply to core 2019-10-25 22:38:30 +02:00
6bdebfbf3c Apply fixes from StyleCI
[ci skip] [skip ci]
2019-10-25 20:33:57 +00:00
58ab6052ad reordered migrations 2019-09-28 21:02:45 +02:00
3737ce8146 Apply fixes from StyleCI
[ci skip] [skip ci]
2019-07-09 20:17:16 +00:00
ca5404db76 Merge branch '1236-user-preferences' of github.com:flarum/core into 1236-user-preferences 2019-07-09 22:17:00 +02:00
d6fc3a91a6 removed references to preferences column, now we need to refactor how notification ppreferences is integrated into the current app 2019-07-09 22:16:51 +02:00
31134ca16d Apply fixes from StyleCI
[ci skip] [skip ci]
2019-07-09 19:42:15 +00:00
6cfc9182f4 added the drop column statement for user.preferences and tested migrations 2019-07-09 21:41:57 +02:00
caa63107ad add migration to drop preferences column 2019-07-09 21:22:37 +02:00
0acab8f1c7 Merge branch 'master' into 1236-user-preferences 2019-07-09 21:19:41 +02:00
b2dbb0439c fixed class property hint for event post content attribute 2019-07-09 08:31:48 +02:00
085c924a07 fix return type hint for event post content attribute 2019-07-09 08:30:10 +02:00
f31f02d4cc Set Whoops middleware HTTP status to error code (#1648)
* Use error code for HTTP status, defaults to 500
* Use logic from HandleErrorsWithView, make sure status is valid
2019-07-07 14:57:40 +02:00
797f6eea50 moved GetDisplayName event to User namespace (#1768) 2019-07-06 19:27:44 +02:00
9fb3a31b51 Get rid of unnecessary method 2019-07-06 02:25:06 +02:00
f8061bbca1 Remove deprecated bootstrap.php fallback
Closes #1557.
2019-07-06 02:11:09 +02:00
de67927ef2 Travis: Allow PHP 7.4 to fail for now
We are currently experiencing issues due to Mockery not yet being 100%
compatible with PHP.

See https://github.com/mockery/mockery/pull/980.
2019-07-06 01:56:54 +02:00
8c841c3266 Update test libraries 2019-07-06 01:49:55 +02:00
2f656146a7 Travis: Test against the upcoming PHP 7.4 2019-07-06 01:30:59 +02:00
d66d2aa26e Convert more helpers in tests 2019-07-06 01:30:59 +02:00
f4c0d4ba87 Type hint contract, not implementation 2019-07-06 01:30:58 +02:00
646bd40bca Use Laravel's class-based Str and Arr helpers
Starting with version 5.9, the global funtions will be deprecated.

* https://laravel-news.com/laravel-5-8-deprecates-string-and-array-helpers
* https://github.com/laravel/framework/pull/26898
2019-07-06 01:30:58 +02:00
307b912019 Issue templates: Remove vulnerability information
GitHub now automatically displays this information (or rather, links to
the Security Policy) at the issue type selection page.
2019-07-06 00:08:55 +02:00
cbc896eba7 Use class constant instead of strings 2019-07-06 00:03:25 +02:00
cc4e4a068b Add descriptions to custom Composer scripts 2019-07-05 23:34:23 +02:00
a720f6f651 Update Application version string to beta 9 (#1784) v0.1.0-beta.9 2019-07-05 12:37:02 +02:00
54d7c0d3b6 Bundled output for commit b5876d9f31faf85564134d8285470aebbe94b66e [skip ci] 2019-06-27 19:23:54 +00:00
b5876d9f31 Merge pull request #1803 from flarum/ds/1777-previous-route-default
Visit home page if previous route does not exist when going back in history
2019-06-27 15:17:41 -04:00