浏览代码

Apply the same type of check for redirect_url

Visman 1 年之前
父节点
当前提交
70e196eefd
共有 3 个文件被更改,包括 5 次插入5 次删除
  1. 2 2
      app/Models/Pages/Moderate.php
  2. 1 1
      app/Models/Pages/Profile/Mod.php
  3. 2 2
      app/Models/Pages/Profile/Search.php

+ 2 - 2
app/Models/Pages/Moderate.php

@@ -613,7 +613,7 @@ class Moderate extends Page
                     $delLinks = [];
                     $delLinks = [];
 
 
                     foreach ($this->c->forums->depthList($root, 0) as $forum) {
                     foreach ($this->c->forums->depthList($root, 0) as $forum) {
-                        if ('' != $forum->redirect_url) {
+                        if ($forum->redirect_url) {
                             continue;
                             continue;
                         }
                         }
 
 
@@ -720,7 +720,7 @@ class Moderate extends Page
                     'type'     => 'checkbox',
                     'type'     => 'checkbox',
                     'value'    => $forum->id,
                     'value'    => $forum->id,
                     'checked'  => ! empty($ft[$forum->id]),
                     'checked'  => ! empty($ft[$forum->id]),
-                    'disabled' => '' != $forum->redirect_url,
+                    'disabled' => ! empty($forum->redirect_url),
                     'caption'  => 'Redir label',
                     'caption'  => 'Redir label',
                 ];
                 ];
                 $form['sets']["forum{$forum->id}"] = [
                 $form['sets']["forum{$forum->id}"] = [

+ 1 - 1
app/Models/Pages/Profile/Mod.php

@@ -142,7 +142,7 @@ class Mod extends Profile
                     'type'     => 'checkbox',
                     'type'     => 'checkbox',
                     'value'    => $forum->id,
                     'value'    => $forum->id,
                     'checked'  => isset($this->curForums[$forum->id]) && $this->curUser->isModerator($forum),
                     'checked'  => isset($this->curForums[$forum->id]) && $this->curUser->isModerator($forum),
-                    'disabled' => ! isset($this->curForums[$forum->id]) || '' != $this->curForums[$forum->id]->redirect_url,
+                    'disabled' => ! isset($this->curForums[$forum->id]) || ! empty($this->curForums[$forum->id]->redirect_url),
                     'caption'  => 'Moderator label',
                     'caption'  => 'Moderator label',
                 ];
                 ];
                 $form['sets']["forum{$forum->id}"] = [
                 $form['sets']["forum{$forum->id}"] = [

+ 2 - 2
app/Models/Pages/Profile/Search.php

@@ -55,7 +55,7 @@ class Search extends Profile
                     $unfollow = [];
                     $unfollow = [];
 
 
                     foreach ($this->curForums as $id => $forum) {
                     foreach ($this->curForums as $id => $forum) {
-                        if ('' == $forum->redirect_url) {
+                        if (empty($forum->redirect_url)) {
                             $unfollow[$id] = $id;
                             $unfollow[$id] = $id;
                         }
                         }
                     }
                     }
@@ -194,7 +194,7 @@ class Search extends Profile
                     'type'     => 'checkbox',
                     'type'     => 'checkbox',
                     'value'    => $forum->id,
                     'value'    => $forum->id,
                     'checked'  => ! isset($this->curUnfollowed[$forum->id]),
                     'checked'  => ! isset($this->curUnfollowed[$forum->id]),
-                    'disabled' => '' != $this->curForums[$forum->id]->redirect_url,
+                    'disabled' => ! empty($this->curForums[$forum->id]->redirect_url),
                     'caption'  => 'Follow label',
                     'caption'  => 'Follow label',
                 ];
                 ];
                 $form['sets']["forum{$forum->id}"] = [
                 $form['sets']["forum{$forum->id}"] = [