diff --git a/legacy/application/common/OsPath.php b/legacy/application/common/OsPath.php index aaf43aec3..bf03f22cf 100644 --- a/legacy/application/common/OsPath.php +++ b/legacy/application/common/OsPath.php @@ -15,7 +15,7 @@ class Application_Common_OsPath $initial_slashes = false; } if ( - ($initial_slashes) + $initial_slashes && (strpos($path, '//') === 0) && (strpos($path, '///') === false) ) { diff --git a/legacy/application/controllers/ApiController.php b/legacy/application/controllers/ApiController.php index 29f9a87fb..5efa1b245 100644 --- a/legacy/application/controllers/ApiController.php +++ b/legacy/application/controllers/ApiController.php @@ -105,14 +105,14 @@ class ApiController extends Zend_Controller_Action $authAdapter = Zend_Auth::getInstance(); Application_Model_Auth::pinSessionToClient($authAdapter); - if ((Zend_Auth::getInstance()->hasIdentity())) { + if (Zend_Auth::getInstance()->hasIdentity()) { return true; } header('HTTP/1.0 401 Unauthorized'); echo _('You are not allowed to access this resource.'); - exit(); + exit; } public function versionAction() diff --git a/legacy/application/controllers/ScheduleController.php b/legacy/application/controllers/ScheduleController.php index 9b4b99a56..9eef37982 100644 --- a/legacy/application/controllers/ScheduleController.php +++ b/legacy/application/controllers/ScheduleController.php @@ -769,7 +769,7 @@ class ScheduleController extends Zend_Controller_Action echo Zend_Json::encode($result); - exit(); + exit; } public function updateFutureIsScheduledAction() diff --git a/legacy/application/controllers/plugins/Acl_plugin.php b/legacy/application/controllers/plugins/Acl_plugin.php index 50e49a634..0aa488c96 100644 --- a/legacy/application/controllers/plugins/Acl_plugin.php +++ b/legacy/application/controllers/plugins/Acl_plugin.php @@ -183,7 +183,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract ->appendBody('ERROR: CSRF token mismatch.') ->sendResponse(); - exit(); + exit; } } diff --git a/legacy/application/models/Block.php b/legacy/application/models/Block.php index 932009470..de85b7b49 100644 --- a/legacy/application/models/Block.php +++ b/legacy/application/models/Block.php @@ -1222,7 +1222,7 @@ SQL; if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') { // if the date isn't relative we want to convert the value to a specific UTC date - if (!(in_array($modifier, ['before', 'after', 'between']))) { + if (!in_array($modifier, ['before', 'after', 'between'])) { $value = Application_Common_DateHelper::UserTimezoneStringToUTCString($value); } else { $value = $value . ' ' . $datetimeunit . ' ago'; @@ -1239,7 +1239,7 @@ SQL; if (isset($d['sp_criteria_extra'])) { if ($field == 'utime' || $field == 'mtime' || $field == 'lptime') { // if the date isn't relative we want to convert the value to a specific UTC date - if (!(in_array($modifier, ['before', 'after', 'between']))) { + if (!in_array($modifier, ['before', 'after', 'between'])) { $extra = Application_Common_DateHelper::UserTimezoneStringToUTCString($extra); } else { $extra = $extra . ' ' . $extradatetimeunit . ' ago'; @@ -1676,7 +1676,7 @@ SQL; // addslashes() does not esapce '%' so we have to do it manually $spCriteriaValue = str_replace('%', '\%', $spCriteriaValue); } else { - $spCriteriaValue = ($criteria['value']); + $spCriteriaValue = $criteria['value']; } $spCriteriaExtra = $criteria['extra']; } @@ -1772,9 +1772,9 @@ SQL; if ($storedCrit['limit']['modifier'] == 'items') { $limits['time'] = 1440 * 60; $limits['items'] = $storedCrit['limit']['value']; - } elseif (($storedCrit['limit']['modifier'] == 'remaining')) { + } elseif ($storedCrit['limit']['modifier'] == 'remaining') { // show will be null unless being called inside a show instance - if (!(is_null($showLimit))) { + if (!is_null($showLimit)) { $limits['time'] = $showLimit; $limits['items'] = null; } else { diff --git a/legacy/application/modules/rest/controllers/PodcastController.php b/legacy/application/modules/rest/controllers/PodcastController.php index 65bef6593..8066c4ee5 100644 --- a/legacy/application/modules/rest/controllers/PodcastController.php +++ b/legacy/application/modules/rest/controllers/PodcastController.php @@ -170,7 +170,7 @@ class Rest_PodcastController extends Zend_Rest_Controller Application_Service_PodcastService::deletePodcastById($id); } - break; + break; case HttpRequestType::GET: $path = 'podcast/podcast.phtml'; @@ -181,7 +181,7 @@ class Rest_PodcastController extends Zend_Rest_Controller ]; } - break; + break; } $this->_helper->json->sendJson($responseBody); diff --git a/legacy/application/services/HistoryService.php b/legacy/application/services/HistoryService.php index 5cf55bd74..813e93369 100644 --- a/legacy/application/services/HistoryService.php +++ b/legacy/application/services/HistoryService.php @@ -437,7 +437,7 @@ class Application_Service_HistoryService Logging::info($shows); // need to filter the list to only their shows - if ((!empty($user)) && ($user->isHost())) { + if ((!empty($user)) && $user->isHost()) { $showIds = []; foreach ($shows as $show) { diff --git a/legacy/application/services/MediaService.php b/legacy/application/services/MediaService.php index 3a4ae0d37..3dc58b121 100644 --- a/legacy/application/services/MediaService.php +++ b/legacy/application/services/MediaService.php @@ -128,7 +128,7 @@ class Application_Service_MediaService */ public static function areFilesStuckInPending() { - $oneHourAgo = gmdate(DEFAULT_TIMESTAMP_FORMAT, (microtime(true) - self::PENDING_FILE_TIMEOUT_SECONDS)); + $oneHourAgo = gmdate(DEFAULT_TIMESTAMP_FORMAT, microtime(true) - self::PENDING_FILE_TIMEOUT_SECONDS); self::$_pendingFiles = CcFilesQuery::create() ->filterByDbImportStatus(CcFiles::IMPORT_STATUS_PENDING) ->filterByDbUtime($oneHourAgo, Criteria::LESS_EQUAL) diff --git a/legacy/application/services/PodcastEpisodeService.php b/legacy/application/services/PodcastEpisodeService.php index df6e680fc..7436f07e0 100644 --- a/legacy/application/services/PodcastEpisodeService.php +++ b/legacy/application/services/PodcastEpisodeService.php @@ -300,7 +300,7 @@ class Application_Service_PodcastEpisodeService extends Application_Service_Thir */ public static function getStuckPendingImports() { - $timeout = gmdate(DEFAULT_TIMESTAMP_FORMAT, (microtime(true) - self::PENDING_EPISODE_TIMEOUT_SECONDS)); + $timeout = gmdate(DEFAULT_TIMESTAMP_FORMAT, microtime(true) - self::PENDING_EPISODE_TIMEOUT_SECONDS); $episodes = PodcastEpisodesQuery::create() ->filterByDbFileId() ->find(); diff --git a/legacy/application/services/SchedulerService.php b/legacy/application/services/SchedulerService.php index 4b2413f29..b7fde662f 100644 --- a/legacy/application/services/SchedulerService.php +++ b/legacy/application/services/SchedulerService.php @@ -324,7 +324,7 @@ class Application_Service_SchedulerService $con->rollback(); Logging::info('Error filling linked shows: ' . $e->getMessage()); - exit(); + exit; } } diff --git a/legacy/application/services/ShowFormService.php b/legacy/application/services/ShowFormService.php index 280cddcc5..50eca9165 100644 --- a/legacy/application/services/ShowFormService.php +++ b/legacy/application/services/ShowFormService.php @@ -326,7 +326,7 @@ class Application_Service_ShowFormService 'add_show_repeat_type' => $repeatType, 'add_show_day_check' => $days, 'add_show_end_date' => (!is_null($repeatEndDate)) ? $repeatEndDate->format('Y-m-d') : null, - 'add_show_no_end' => (is_null($repeatEndDate)), + 'add_show_no_end' => is_null($repeatEndDate), 'add_show_monthly_repeat_type' => $monthlyRepeatType, ] ); diff --git a/legacy/application/services/ShowService.php b/legacy/application/services/ShowService.php index b1fc2e006..1f5d8dd70 100644 --- a/legacy/application/services/ShowService.php +++ b/legacy/application/services/ShowService.php @@ -883,11 +883,10 @@ SQL; CcShowQuery::create() ->filterByDbId($showId) ->delete(); - /* There is only one cc_show_instance if the user selects 'Delete This Instance' - * There is more than one cc_show_instance if the user selects 'Delete This - * Instance and All Following'. We only need to set the last_show value - * when 'Delete This Instance and All Following' has been selected - */ + // There is only one cc_show_instance if the user selects 'Delete This Instance' + // There is more than one cc_show_instance if the user selects 'Delete This + // Instance and All Following'. We only need to set the last_show value + // when 'Delete This Instance and All Following' has been selected } elseif (count($ccShowInstances) > 1) { $this->setLastRepeatingShowDate($showId); } diff --git a/legacy/public/index.php b/legacy/public/index.php index 735982c2b..1c7d5ead9 100644 --- a/legacy/public/index.php +++ b/legacy/public/index.php @@ -22,7 +22,7 @@ function showConfigCheckPage() require_once CONFIG_PATH . '/config-check.php'; - exit(); + exit; } function isApiCall()