mirror of
https://github.com/flarum/core.git
synced 2025-08-04 07:27:39 +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:
@@ -12,6 +12,7 @@
|
||||
namespace Flarum\Frontend\Content;
|
||||
|
||||
use Flarum\Frontend\Document;
|
||||
use Illuminate\Support\Arr;
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
class Meta
|
||||
@@ -28,8 +29,8 @@ class Meta
|
||||
|
||||
$meta = [
|
||||
'viewport' => 'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1',
|
||||
'description' => array_get($forumApiDocument, 'data.attributes.description'),
|
||||
'theme-color' => array_get($forumApiDocument, 'data.attributes.themePrimaryColor')
|
||||
'description' => Arr::get($forumApiDocument, 'data.attributes.description'),
|
||||
'theme-color' => Arr::get($forumApiDocument, 'data.attributes.themePrimaryColor')
|
||||
];
|
||||
|
||||
return $meta;
|
||||
@@ -39,7 +40,7 @@ class Meta
|
||||
{
|
||||
$head = [];
|
||||
|
||||
if ($faviconUrl = array_get($document->getForumApiDocument(), 'data.attributes.faviconUrl')) {
|
||||
if ($faviconUrl = Arr::get($document->getForumApiDocument(), 'data.attributes.faviconUrl')) {
|
||||
$head['favicon'] = '<link rel="shortcut icon" href="'.e($faviconUrl).'">';
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user