mirror of
https://github.com/flarum/core.git
synced 2025-10-12 15:34:26 +02:00
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
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Flarum\Extension;
|
||||
use Flarum\Extension\Event\Disabling;
|
||||
use Flarum\Http\Exception\ForbiddenException;
|
||||
use Flarum\Settings\SettingsRepositoryInterface;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class DefaultLanguagePackGuard
|
||||
{
|
||||
@@ -34,7 +35,7 @@ class DefaultLanguagePackGuard
|
||||
}
|
||||
|
||||
$defaultLocale = $this->settings->get('default_locale');
|
||||
$locale = array_get($event->extension->extra, 'flarum-locale.code');
|
||||
$locale = Arr::get($event->extension->extra, 'flarum-locale.code');
|
||||
|
||||
if ($locale === $defaultLocale) {
|
||||
throw new ForbiddenException('You cannot disable the default language pack!');
|
||||
|
Reference in New Issue
Block a user