Unconditionally assign smarty variable
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 4 Sep 2023 23:56:09 +0000 (11:56 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 4 Sep 2023 23:56:09 +0000 (11:56 +1200)
CRM/Mailing/Page/Browse.php

index eca527d5dce7df0d0db8b8c975f4a56e91fe64b7..6fd93bdfa0248e70163bfcd5f2a52e31e97de625 100644 (file)
@@ -105,13 +105,13 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page {
     if (CRM_Core_Permission::check('access CiviMail')) {
       $archiveLinks = TRUE;
     }
-    if ($archiveLinks == TRUE) {
-      $this->assign('archiveLinks', $archiveLinks);
-    }
+    $this->assign('archiveLinks', $archiveLinks ?? FALSE);
   }
 
   /**
    * Run this page (figure out the action needed and perform it).
+   *
+   * @throws \CRM_Core_Exception
    */
   public function run() {
     $this->preProcess();
@@ -122,19 +122,19 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page {
       = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this);
 
     // CRM-11920 "all" should set sortByCharacter to null, not empty string
-    if (strtolower($this->_sortByCharacter ?: '') == 'all' || !empty($_POST)) {
+    if (strtolower($this->_sortByCharacter ?: '') === 'all' || !empty($_POST)) {
       $this->_sortByCharacter = NULL;
       $this->set('sortByCharacter', NULL);
     }
 
-    if (($newArgs[3] ?? NULL) == 'unscheduled') {
+    if (($newArgs[3] ?? NULL) === 'unscheduled') {
       $this->_unscheduled = TRUE;
     }
     $this->set('unscheduled', $this->_unscheduled);
 
     $this->set('archived', $this->isArchived($newArgs));
 
-    if (($newArgs[3] ?? NULL) == 'scheduled') {
+    if (($newArgs[3] ?? NULL) === 'scheduled') {
       $this->_scheduled = TRUE;
     }
     $this->set('scheduled', $this->_scheduled);
@@ -243,7 +243,7 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page {
     if ($this->get('sms')) {
       $urlParams .= '&sms=1';
     }
-    if (($newArgs[3] ?? NULL) == 'unscheduled') {
+    if (($newArgs[3] ?? NULL) === 'unscheduled') {
       $urlString .= '/unscheduled';
       $urlParams .= '&scheduled=false';
       $this->assign('unscheduled', TRUE);