Browse Source

Apply the same type of check for redirect_url

Visman 1 year ago
parent
commit
70e196eefd

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

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

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

@@ -142,7 +142,7 @@ class Mod extends Profile
                     'type'     => 'checkbox',
                     'value'    => $forum->id,
                     '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',
                 ];
                 $form['sets']["forum{$forum->id}"] = [

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

@@ -55,7 +55,7 @@ class Search extends Profile
                     $unfollow = [];
 
                     foreach ($this->curForums as $id => $forum) {
-                        if ('' == $forum->redirect_url) {
+                        if (empty($forum->redirect_url)) {
                             $unfollow[$id] = $id;
                         }
                     }
@@ -194,7 +194,7 @@ class Search extends Profile
                     'type'     => 'checkbox',
                     'value'    => $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',
                 ];
                 $form['sets']["forum{$forum->id}"] = [