Skip to content

Commit

Permalink
fixed str_contains bug
Browse files Browse the repository at this point in the history
  • Loading branch information
songdengfeng committed Sep 4, 2021
1 parent 1b3ddd3 commit b0b7bd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Middleware/AdminAuthenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function handle($request, Closure $next)
return $next($request);
}
/*加入权限检测逻辑*/
if(!str_contains($routeName,['admin.setting'])){
if(!str_contains($routeName,'admin.setting')){
$routeName = substr($routeName,0,strripos($routeName,".")) . '.index';
}
if(!$request->user()->hasPermission($routeName)){
Expand Down
2 changes: 1 addition & 1 deletion app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function parse_seo_template($type, $source)
$seo_template = str_replace("{wzmc}", Setting()->get('website_name'), $seo_template);
$seo_template = str_replace("{wzkh}", Setting()->get('website_slogan'), $seo_template);

if (str_contains($type, ['question', 'article'])) {
if (in_array($type, ['question', 'article'])) {
if ($source->tags) {
$tagList = array_pluck($source->tags->toArray(), 'name');
$seo_template = str_replace("{htlb}", implode(",", $tagList), $seo_template);
Expand Down

0 comments on commit b0b7bd5

Please sign in to comment.