1
0
mirror of https://github.com/flarum/core.git synced 2025-08-29 19:09:58 +02:00
Commit Graph

8263 Commits

Author SHA1 Message Date
Franz Liedke
405cd8764e Add error message for invalid confirmation tokens
Fixes flarum/core#1337.
2019-08-14 19:39:52 +02:00
Franz Liedke
f020719a84 Update error keys to match based on exception type
...instead of status code. There are (or will be) multiple different
keys for similar errors with the same status code. In the future, we
will use the error's "type" (see flarum/core#1843) to distinguish them.

Refs flarum/core#1641.
2019-08-14 19:38:54 +02:00
Franz Liedke
a8bd284c1a Remove obsolete translation for maintenance mode
We currently don't have a pretty error page for maintenance mode.
2019-08-14 18:09:51 +02:00
flarum-bot
40a8068dea Bundled output for commit 4cd48ac048 [skip ci] 2019-08-14 06:41:45 +00:00
Franz Liedke
03f4305497 Add translations for user deletion status
Replaces #142.
Refs flarum/core#1750, flarum/core#1788.
2019-08-14 08:35:25 +02:00
Franz Liedke
4cd48ac048 Tweak translation keys, always use full keys
Makes them easier to grep when editing / removing.

Refs #1750, #1788.
2019-08-14 08:34:36 +02:00
Franz Liedke
e7cdd497dd Extract real method
Refs #1750, #1788.
2019-08-14 08:34:14 +02:00
flarum-bot
c3740281b6 Bundled output for commit be6d42d46f [skip ci] 2019-08-13 21:02:10 +00:00
Tobias Karlsson
be6d42d46f Improve feedback on user deletion
Fixes #1750, #1777
2019-08-13 22:56:24 +02:00
Franz Liedke
fcb3921a42 Merge pull request #1843 from flarum/fl/1641-exception-handling
Implement new error handling stack
2019-08-13 22:45:46 +02:00
David Sevilla Martin
8277b54651 Add image button (flarum/core#1679) 2019-08-11 16:06:30 -04:00
Franz Liedke
01c77b8e2a Support multiple error reporters
The error handling middleware now expects an array of reporters.
Extensions can register new reporters in the container like this:

    use Flarum\Foundation\ErrorHandling\Reporter;

    $container->tag(NewReporter::class, Reporter::class);

Note that this is just an implementation detail and will be hidden
behind an extender.
2019-08-10 11:04:12 +02:00
Franz Liedke
f73a39d3f4 Remove old error handler, middleware and tests 2019-08-10 00:26:24 +02:00
Franz Liedke
8e0cd27f54 API Client: Use new error handling mechanism 2019-08-10 00:26:24 +02:00
Franz Liedke
410028dae6 Use new error handler middleware 2019-08-10 00:26:24 +02:00
Franz Liedke
817e54abe0 Wire up new error handling stack 2019-08-10 00:26:23 +02:00
Franz Liedke
13377100fb Make existing extensions compatible with new stack 2019-08-10 00:26:22 +02:00
Franz Liedke
11e76b1965 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.
2019-08-10 00:26:22 +02:00
Franz Liedke
dbbfb01e3a Remove obsolete constructor parameter
This was removed in commit 7b2807a8.
2019-08-10 00:16:21 +02:00
flarum-bot
e79d1b8f6b Bundled output for commit 1702929079 [skip ci] 2019-08-08 23:12:56 +00:00
Franz Liedke
1702929079 a11y: Try to make screenreaders read tooltips
Refs #1835.
2019-08-08 22:40:30 +02:00
David Sevilla Martín
b3019e72fe Add canonical URL to discussion list (#1814) 2019-08-08 00:01:25 +02:00
David Sevilla Martin
eb561e6343 Fix 'polyfills' incorrect spelling, add LICENSE text for startsWith polyfill 2019-08-03 09:14:24 -04:00
flarum-bot
68dcc83582 Bundled output for commit 5fe1de86dc [skip ci] 2019-08-01 21:18:40 +00:00
David Sevilla Martín
5fe1de86dc Update to Twemoji 12 and switch to 'simple-emoji-map' (#20) 2019-08-01 23:17:25 +02:00
Franz Liedke
2fc2cd5863 Bypass CSRF token check when using access tokens
Fixes #1828.
2019-08-01 22:53:31 +02:00
Franz Liedke
51b33c8cab Make exception message dynamic as well 2019-08-01 22:25:28 +02:00
Daniël Klabbers
a46c9b0c1d Merge branch 'master' of github.com:flarum/core 2019-07-31 17:10:47 +02:00
Daniël Klabbers
9209a5f588 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.
2019-07-31 17:10:13 +02:00
Franz Liedke
1169e4aca6 Determine default route after extensions
Fixes #1819.
2019-07-30 00:56:29 +02:00
Franz Liedke
b59aef7838 PHPUnit: Get rid of deprecated annotation
Refs #1795.
2019-07-30 00:09:10 +02:00
Daniël Klabbers
720c88e73a fixes #1695, take into consideration is_private with counts on User stats 2019-07-28 20:59:12 +02:00
Daniël Klabbers
6745f55ad7 fixed ci, make green again; mysql service wasnt booted 2019-07-27 22:24:39 +02:00
Franz Liedke
7ca47b67c3 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.
2019-07-23 23:55:06 +02:00
Franz Liedke
10ba2e9464 Revert "Remove deprecated bootstrap.php fallback"
This reverts commit 4abd6d61a9.

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.
2019-07-14 22:22:06 +02:00
Franz Liedke
928b360135 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.
2019-07-11 22:35:19 +02:00
dependabot[bot]
2697397376 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>
2019-07-11 09:21:17 +02:00
David Sevilla Martín
f4e250f514 Simplify some code in MarkdownButton component 2019-07-10 12:41:05 -04:00
David Sevilla Martín
50a4530cfc Use custom JSX implementation of GitHub's markdown toolbar that works in IE 11 2019-07-10 12:30:35 -04:00
Daniël Klabbers
ffb7495266 fixed class property hint for event post content attribute 2019-07-09 08:31:48 +02:00
Daniël Klabbers
84a3edaba8 fix return type hint for event post content attribute 2019-07-09 08:30:10 +02:00
flarum-bot
d43e071a99 Bundled output for commit 8ef1d3bdea [skip ci] 2019-07-07 15:24:34 +00:00
David Sevilla Martín
8ef1d3bdea Fix default value for useColor overriding falsy values (#63)
This would make the 'useColor' setting irrelevant as it would always be true.
Error is noticeable in the discussion list when the icons are the same color as the tag background
2019-07-07 17:23:22 +02:00
David Sevilla Martín
aa442f2cb8 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
Daniël Klabbers
7e0855d9da moved GetDisplayName event to User namespace (#1768) 2019-07-06 19:27:44 +02:00
Franz Liedke
741ce3acd4 Get rid of unnecessary method 2019-07-06 02:25:06 +02:00
Franz Liedke
4abd6d61a9 Remove deprecated bootstrap.php fallback
Closes #1557.
2019-07-06 02:11:09 +02:00
Franz Liedke
f19d80ee0f 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
Franz Liedke
67040303f9 Update test libraries 2019-07-06 01:49:55 +02:00
Franz Liedke
7c05033405 Travis: Test against the upcoming PHP 7.4 2019-07-06 01:30:59 +02:00