Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce 65k character limit when attempting to update setting values. #3162

Merged
merged 14 commits into from
Nov 12, 2021
Prev Previous commit
Next Next commit
Style fixes.
  • Loading branch information
grimmdude committed Nov 12, 2021
commit 102e70d069b6a3ea7ce58455eaa2dcdecfff7675
4 changes: 1 addition & 3 deletions src/Forum/ForumServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@
use Flarum\Settings\Event\Saved;
use Flarum\Settings\Event\Saving;
use Flarum\Settings\SettingsRepositoryInterface;
use Flarum\Settings\SettingsValidator;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Validation\Factory as ValidatorFactory;
use Illuminate\Contracts\View\Factory;
use Laminas\Stratigility\MiddlewarePipe;
use Symfony\Contracts\Translation\TranslatorInterface;
Expand Down Expand Up @@ -133,7 +131,7 @@ public function register()
});
}

public function boot(Container $container, Dispatcher $events, Factory $view, ValidatorFactory $validatorFactory)
public function boot(Container $container, Dispatcher $events, Factory $view)
{
$this->loadViewsFrom(__DIR__.'/../../views', 'flarum.forum');

Expand Down
1 change: 0 additions & 1 deletion src/Settings/SettingsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public function register()
$this->container->alias(SettingsRepositoryInterface::class, 'flarum.settings');
}


public function boot(Dispatcher $events, SettingsValidator $settingsValidator)
{
$events->listen(
Expand Down
5 changes: 2 additions & 3 deletions src/Settings/SettingsValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ class SettingsValidator extends AbstractValidator
*/
protected $rules = [];


/**
* These rules apply to all attributes.
*
*
* Entries in the default DB settings table are limited to 65,000
* characters. We validate against this to avoid confusing errors.
*
*
* @var array
*/
protected $globalRules = [
Expand Down