diff --git a/e107_handlers/application.php b/e107_handlers/application.php index 5044351ce..3b4b87ad8 100644 --- a/e107_handlers/application.php +++ b/e107_handlers/application.php @@ -589,9 +589,8 @@ class eDispatcher $controller->dispatch($actionName); - $content = ob_get_contents(); - ob_end_clean(); - + $content = ob_get_clean(); + $response->appendBody($content); unset($controller); } @@ -3204,7 +3203,7 @@ class eController */ public function __call($methodName, $args) { - if ('action' == substr($methodName, 0, 6)) + if (strpos($methodName, 'action') === 0) { $action = substr($methodName, 6); throw new eException('Action "'.$action.'" does not exist', 2404); diff --git a/e107_handlers/bbcode_handler.php b/e107_handlers/bbcode_handler.php index 788994ba1..23475afce 100644 --- a/e107_handlers/bbcode_handler.php +++ b/e107_handlers/bbcode_handler.php @@ -396,8 +396,7 @@ class e_bbcode $error = $debugFile." -- ".$e->getMessage(); } - $bbcode_output = ob_get_contents(); - ob_end_clean(); + $bbcode_output = ob_get_clean(); if(!empty($error)) { @@ -429,7 +428,7 @@ class e_bbcode return null; } - if(substr(ltrim($text),0,6) == '[html]' && $type == 'img') // support for html img tags inside [html] bbcode. + if(strpos(ltrim($text), '[html]') === 0 && $type == 'img') // support for html img tags inside [html] bbcode. { $tmp = e107::getParser()->getTags($text,'img'); diff --git a/e107_handlers/bounce_handler.php b/e107_handlers/bounce_handler.php index 124890d98..d46e87459 100644 --- a/e107_handlers/bounce_handler.php +++ b/e107_handlers/bounce_handler.php @@ -223,7 +223,7 @@ $mailManager = e107::getBulkEmail(); - $debug = ($this->debug === 2) ? true : false; + $debug = $this->debug === 2; $mailManager->controlDebug($debug); diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index 5549c0c4b..a3e6efc0b 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -186,7 +186,7 @@ class comment { $itemid = $id; - if ($action == "reply" && substr($subject, 0, 4) != "Re: ") + if ($action == "reply" && strpos($subject, "Re: ") !== 0) { $subject = COMLAN_325.' '.$subject; } @@ -657,7 +657,7 @@ class comment { if ($var == e_UC_MEMBER) // different behavior to check_class(); { - return (USER == TRUE && ADMIN == FALSE) ? TRUE : FALSE; + return (USER == true && ADMIN == false); } return check_class($var); diff --git a/e107_handlers/core_functions.php b/e107_handlers/core_functions.php index 319a7ee02..0aad530b3 100644 --- a/e107_handlers/core_functions.php +++ b/e107_handlers/core_functions.php @@ -590,7 +590,7 @@ class e_array { $ArrayData = (string) substr($ArrayData,8); } - if(strtolower(substr($ArrayData,0,5)) !== 'array') + if(stripos($ArrayData, 'array') !== 0) { return false; } diff --git a/e107_handlers/cron_class.php b/e107_handlers/cron_class.php index 46708c84c..26d4c3297 100644 --- a/e107_handlers/cron_class.php +++ b/e107_handlers/cron_class.php @@ -160,7 +160,7 @@ class _system_cron $userVars = array(); foreach($userCon['user'] as $k=>$v) { - if(substr($k,0,2) == 'e_') + if(strpos($k, 'e_') === 0) { $userVars[$k] = $v; } @@ -697,34 +697,30 @@ class CronParser function _getLastMonth() { $months = $this->_getMonthsArray(); - $month = array_pop($months); - return $month; + return array_pop($months); } function _getLastDay($month, $year) { //put the available days for that month into an array $days = $this->_getDaysArray($month, $year); - $day = array_pop($days); - return $day; + return array_pop($days); } function _getLastHour() { $hours = $this->_getHoursArray(); - $hour = array_pop($hours); - return $hour; + return array_pop($hours); } function _getLastMinute() { $minutes = $this->_getMinutesArray(); - $minute = array_pop($minutes); - return $minute; + return array_pop($minutes); } //remove the out of range array elements. $arr should be sorted already and does not contain duplicates diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index 7c2ff2541..a75e0f66d 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -1014,8 +1014,7 @@ ob_start(); var_dump($message); - $content = ob_get_contents(); - ob_end_clean(); + $content = ob_get_clean(); $bt = debug_backtrace(); diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 3d0b34a80..4c61a2d9c 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -932,8 +932,8 @@ class e107 */ function getSitePath() { - $self = self::getInstance(); - return $self->site_path; + + return self::getInstance()->site_path; } /** diff --git a/e107_handlers/e_customfields_class.php b/e107_handlers/e_customfields_class.php index 6aad56d24..fc365d03a 100644 --- a/e107_handlers/e_customfields_class.php +++ b/e107_handlers/e_customfields_class.php @@ -133,7 +133,7 @@ $tp = e107::getParser(); $value = $this->_data[$key]; - $raw = (!empty($parm['mode']) && $parm['mode'] === 'raw') ? true : false; + $raw = (!empty($parm['mode']) && $parm['mode'] === 'raw'); $type = (!empty($parm['type'])) ? $parm['type'] : null; $fieldType = $this->_config[$key]['type']; @@ -536,7 +536,7 @@ foreach($new_data as $k=>$v) { - if(substr($k,0,$len) === $fieldname) + if(strpos($k, $fieldname) === 0) { list($tmp,$newkey) = explode('__',$k); $new_data[$fieldname][$newkey] = $v; diff --git a/e107_handlers/e_db_pdo_class.php b/e107_handlers/e_db_pdo_class.php index 63977adca..321fba80a 100644 --- a/e107_handlers/e_db_pdo_class.php +++ b/e107_handlers/e_db_pdo_class.php @@ -2194,8 +2194,8 @@ class e_db_pdo implements e_db $table[] = str_replace($prefix,"",$rows[0]); } } - $ret = array($language=>$table); - return $ret; + + return array($language =>$table); } else { diff --git a/e107_handlers/e_marketplace.php b/e107_handlers/e_marketplace.php index 184171425..40a8304fd 100644 --- a/e107_handlers/e_marketplace.php +++ b/e107_handlers/e_marketplace.php @@ -411,7 +411,7 @@ abstract class e_marketplace_adapter_abstract */ public function hasAuthKey() { - return ($this->authKey !== null) ? true : false; + return $this->authKey !== null; } /** @@ -1169,7 +1169,7 @@ class eAuth $total = array(); foreach($params as $k => $v) { - if(substr($k, 0, 5) != "eauth") continue; + if(strpos($k, "eauth") !== 0) continue; if(is_array($v)) { throw new Exception('Arrays not supported in headers', 200); diff --git a/e107_handlers/file_class.php b/e107_handlers/file_class.php index a3f73fadf..c40603762 100644 --- a/e107_handlers/file_class.php +++ b/e107_handlers/file_class.php @@ -229,7 +229,7 @@ { $ret = array(); $invert = false; - if(substr($fmask, 0, 1) == '~') + if(strpos($fmask, '~') === 0) { $invert = true; // Invert selection - exclude files which match selection $fmask = substr($fmask, 1); @@ -1574,7 +1574,7 @@ // print_a($headers); - return (stripos($headers[0], "200 OK") || strpos($headers[0], "302")) ? true : false; + return (stripos($headers[0], "200 OK") || strpos($headers[0], "302")); } diff --git a/e107_handlers/iphandler_class.php b/e107_handlers/iphandler_class.php index 8d9f567e8..56fc6820a 100644 --- a/e107_handlers/iphandler_class.php +++ b/e107_handlers/iphandler_class.php @@ -198,7 +198,7 @@ class eIPHandler public function debug($value) { - $this->debug = ($value === true) ? true: false; + $this->debug = $value === true; } @@ -314,7 +314,7 @@ class eIPHandler if ($ip == 'ff02:0000:0000:0000:0000:0000:0000:0001') return FALSE; if ($ip == '::1') return FALSE; // localhost if ($ip == '0000:0000:0000:0000:0000:0000:0000:0001') return FALSE; - if (substr($ip, 0, 5) == 'fc00:') return FALSE; // local addresses + if (strpos($ip, 'fc00:') === 0) return FALSE; // local addresses // @todo add: // ::0 (all zero) - invalid // ff02::1:ff00:0/104 - Solicited-Node multicast addresses - add? @@ -397,7 +397,7 @@ class eIPHandler $vals = file($fileName); if ($vals === FALSE || count($vals) == 0) return; - if (substr($vals[0], 0, 5) != ' 1) $ret .= '::'; else $ret .= ':0'; } - if ($IP4Legacy && (substr($ret,0,7) == '::ffff:')) + if ($IP4Legacy && (strpos($ret, '::ffff:') === 0)) { $temp = str_replace(':', '', substr($ip,-9, 9)); $tmp = str_split($temp, 2); // Four 2-character hex values @@ -1553,11 +1553,11 @@ class banlistManager $vals = file($fileName); if ($vals === FALSE) return $ret; - if (substr($vals[0], 0, 5) == ' $numEntry) return $ret; // Empty return if beyond the end if ($count == 0) return $vals; // Special case - return the lot in ascending date order diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 0cc74609a..00b769e56 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -1249,8 +1249,8 @@ class e_jsmanager if($return) { - $ret = ob_get_contents(); - ob_end_clean(); + $ret = ob_get_clean(); + return $ret; } } @@ -1565,7 +1565,7 @@ class e_jsmanager */ private function addCache($type,$path) { - if($this->_cache_enabled != true || $this->isInAdmin() || substr($path,0,2) == '//' || strpos($path, 'wysiwyg.php')!==false ) + if($this->_cache_enabled != true || $this->isInAdmin() || strpos($path, '//') === 0 || strpos($path, 'wysiwyg.php')!==false ) { return false; } diff --git a/e107_handlers/jslib_handler.php b/e107_handlers/jslib_handler.php index fd2459110..2f689db5f 100644 --- a/e107_handlers/jslib_handler.php +++ b/e107_handlers/jslib_handler.php @@ -172,10 +172,9 @@ class e_jslib $pref = e107::getPref(); $encoding = $this->browser_enc(); - $contents = ob_get_contents(); - ob_end_clean(); - - if(!deftrue('e_NOCACHE')) header('Cache-Control: must-revalidate', true); + $contents = ob_get_clean(); + + if(!deftrue('e_NOCACHE')) header('Cache-Control: must-revalidate', true); $etag = md5($page).($encoding ? '-'.$encoding : ''); header('ETag: '.$etag, true); diff --git a/e107_handlers/library_manager.php b/e107_handlers/library_manager.php index 3dd3000ac..70add211e 100755 --- a/e107_handlers/library_manager.php +++ b/e107_handlers/library_manager.php @@ -1093,7 +1093,7 @@ class e_library_manager $libraryPath = !empty($library['library_path']) ? e107::getParser()->replaceConstants($library['library_path']) : ''; - if(empty($library['library_path']) || (!empty($libraryPath) && !file_exists($libraryPath) && substr($libraryPath, 0, 4) != 'http')) + if(empty($library['library_path']) || (!empty($libraryPath) && !file_exists($libraryPath) && strpos($libraryPath, 'http') !== 0)) { $library['error'] = LAN_NOT_FOUND; @@ -2104,7 +2104,7 @@ class e_library_manager // If remote file (e.g. CDN URL)... we download file to temp, and get version number. // The library will be cached with version number, so this only run once per library. - if(substr($file, 0, 4) == 'http') + if(strpos($file, 'http') === 0) { $content = e107::getFile()->getRemoteContent($file); $tmpFile = tempnam(sys_get_temp_dir(), 'lib_'); diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index 5e6992fbc..002c5d181 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -219,9 +219,8 @@ class e_menuManager function menuRenderMessage() { // return $this->menuMessage; - $text = e107::getMessage()->render('menuUi'); - // $text .= "ID = ".$this->menuId; - return $text; + // $text .= "ID = ".$this->menuId; + return e107::getMessage()->render('menuUi'); } diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index 07d360bd2..fbfd40a58 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -2124,8 +2124,8 @@ class e_db_mysql implements e_db $table[] = str_replace($prefix,"",$rows[0]); } } - $ret = array($language=>$table); - return $ret; + + return array($language =>$table); } else { diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 3ea83b990..526be5e6a 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -217,7 +217,7 @@ class e_plugin if(isset($this->_data[$this->_plugdir]['@attributes']['installRequired'])) { - return ($this->_data[$this->_plugdir]['@attributes']['installRequired'] === 'false') ? false : true; + return $this->_data[$this->_plugdir]['@attributes']['installRequired'] !== 'false'; } return false; @@ -486,7 +486,7 @@ class e_plugin public function isValidAddonMarkup($content='') { - if ((substr($content, 0, 5) != '<'.'?php')) + if ((strpos($content, '<' . '?php') !== 0)) { return false; } @@ -1173,7 +1173,7 @@ class e_plugin } } // new shortcodes location - shortcodes/single/*.php - elseif (substr($adds, 0, 3) === "sc_") + elseif (strpos($adds, "sc_") === 0) { $sc_name = substr(substr($adds, 3), 0, -4); // remove the sc_ and .php @@ -1196,7 +1196,7 @@ class e_plugin $bb_array[$bb_name] = "0"; // default userclass. } // bbcode class - elseif(substr($adds, 0, 3) == "bb_" && substr($adds, -4) == ".php") + elseif(strpos($adds, "bb_") === 0 && substr($adds, -4) == ".php") { $bb_name = substr($adds, 0,-4); // remove the .php $bb_name = substr($bb_name, 3); @@ -2513,7 +2513,7 @@ class e107plugin $newvals = array_unique($newvals); $pref[$prefname] = implode(',', $newvals); - if (substr($pref[$prefname], 0, 1) == ",") + if (strpos($pref[$prefname], ",") === 0) { $pref[$prefname] = substr($pref[$prefname], 1); } @@ -3604,7 +3604,7 @@ class e107plugin { $attrib = $link['@attributes']; $linkName = (defset($link['@value'])) ? constant($link['@value']) : vartrue($link['@value'],''); - $remove = (varset($attrib['deprecate']) == 'true') ? TRUE : FALSE; + $remove = varset($attrib['deprecate']) == 'true'; $url = vartrue($attrib['url']); $perm = vartrue($attrib['perm'],'everyone'); $sef = vartrue($attrib['sef']); @@ -3656,7 +3656,7 @@ class e107plugin } } - return ($status === E_MESSAGE_SUCCESS) ? true : false; + return $status === E_MESSAGE_SUCCESS; } /** @@ -3834,7 +3834,7 @@ class e107plugin $attrib = $uclass['@attributes']; $name = $attrib['name']; $description = $attrib['description']; - $remove = (varset($attrib['deprecate']) == 'true') ? TRUE : FALSE; + $remove = varset($attrib['deprecate']) == 'true'; switch ($function) { @@ -3905,7 +3905,7 @@ class e107plugin //$name = 'plugin_'.$this->plugFolder.'_'.$attrib['name']; $source = 'plugin_'.$this->plugFolder; - $remove = (varset($attrib['deprecate']) == 'true') ? TRUE : FALSE; + $remove = varset($attrib['deprecate']) == 'true'; if(!isset($attrib['system'])) { @@ -3913,7 +3913,7 @@ class e107plugin } else { - $attrib['system'] = ($attrib['system'] === 'true') ? true : false; + $attrib['system'] = $attrib['system'] === 'true'; } switch ($function) @@ -4001,7 +4001,7 @@ class e107plugin $value = $tmp; } - $remove = (varset($tag['@attributes']['deprecate']) == 'true') ? TRUE : FALSE; + $remove = varset($tag['@attributes']['deprecate']) == 'true'; if (varset($tag['@attributes']['value'])) { @@ -4682,7 +4682,7 @@ class e107plugin } } // new shortcodes location - shortcodes/single/*.php - elseif (substr($adds, 0, 3) === "sc_") + elseif (strpos($adds, "sc_") === 0) { $sc_name = substr(substr($adds, 3), 0, -4); // remove the sc_ and .php @@ -4705,7 +4705,7 @@ class e107plugin $bb_array[$bb_name] = "0"; // default userclass. } // bbcode class - elseif(substr($adds, 0, 3) == "bb_" && substr($adds, -4) == ".php") + elseif(strpos($adds, "bb_") === 0 && substr($adds, -4) == ".php") { $bb_name = substr($adds, 0,-4); // remove the .php $bb_name = substr($bb_name, 3); @@ -4798,7 +4798,7 @@ class e107plugin { $passfail = ''; $file_text = file_get_contents(e_PLUGIN.$plugin_path."/".$addonPHP); - if ((substr($file_text, 0, 5) != '<'.'?php') || ((substr($file_text, -2, 2) != '?'.'>') && (strrpos($file_text, '?'.'>') !== FALSE))) + if ((strpos($file_text, '<' . '?php') !== 0) || ((substr($file_text, -2, 2) != '?'.'>') && (strrpos($file_text, '?'.'>') !== FALSE))) { $passfail = 'fail'; } @@ -4901,7 +4901,7 @@ class e107plugin } // Generic markup check - if ((substr($content, 0, 5) != '<'.'?php') || ((substr($content, -2, 2) != '?'.'>') && (strrpos($content, '?'.'>') !== FALSE))) + if ((strpos($content, '<' . '?php') !== 0) || ((substr($content, -2, 2) != '?'.'>') && (strrpos($content, '?'.'>') !== FALSE))) { return 1; } diff --git a/e107_handlers/pop3_class.php b/e107_handlers/pop3_class.php index 1cb4f8c5f..c5f3dfe37 100644 --- a/e107_handlers/pop3_class.php +++ b/e107_handlers/pop3_class.php @@ -53,7 +53,7 @@ class receiveMail $mail_header=imap_header($this->marubox,$mid); $sender=$mail_header->from[0]; $sender_replyto=$mail_header->reply_to[0]; - $stat = (strtolower($sender->mailbox)!='mailer-daemon' && strtolower($sender->mailbox)!='postmaster') ? FALSE : TRUE; + $stat = !(strtolower($sender->mailbox) != 'mailer-daemon' && strtolower($sender->mailbox) != 'postmaster'); if(strpos($mail_header->subject,"delayed")){ $stat = FALSE; } diff --git a/e107_handlers/pop_bounce_handler.php b/e107_handlers/pop_bounce_handler.php index ea440a48d..9823374fe 100644 --- a/e107_handlers/pop_bounce_handler.php +++ b/e107_handlers/pop_bounce_handler.php @@ -98,7 +98,7 @@ class pop3BounceHandler $mail_header=imap_header($this->mailResource,$mid); $sender=$mail_header->from[0]; $sender_replyto=$mail_header->reply_to[0]; - $stat = (strtolower($sender->mailbox)!='mailer-daemon' && strtolower($sender->mailbox)!='postmaster') ? FALSE : TRUE; + $stat = !(strtolower($sender->mailbox) != 'mailer-daemon' && strtolower($sender->mailbox) != 'postmaster'); if(strpos($mail_header->subject,"delayed")) { $stat = FALSE; diff --git a/e107_handlers/search/search_comment.php b/e107_handlers/search/search_comment.php index af39d888d..b3d5869d1 100644 --- a/e107_handlers/search/search_comment.php +++ b/e107_handlers/search/search_comment.php @@ -59,8 +59,7 @@ $results = $ps['results']; function search_comment($row) { if (is_callable('com_search_'.$row['comment_type'])) { - $res = call_user_func('com_search_'.$row['comment_type'], $row); - return $res; + return call_user_func('com_search_'.$row['comment_type'], $row); } } diff --git a/e107_handlers/search_class.php b/e107_handlers/search_class.php index 98146c457..28a237c80 100644 --- a/e107_handlers/search_class.php +++ b/e107_handlers/search_class.php @@ -73,7 +73,7 @@ class e_search $this -> keywords['boolean'][$k_key] = FALSE; $this -> keywords['match'][$k_key] = $key; } - $this -> keywords['exact'][$k_key] = ($tp->ustrpos($key, ' ') !== FALSE) ? TRUE : FALSE; + $this -> keywords['exact'][$k_key] = $tp->ustrpos($key, ' ') !== false; $this -> keywords['match'][$k_key] = $tp -> toDB($this -> keywords['match'][$k_key]); } else { diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 19de7e4e6..4fdec076b 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -92,7 +92,7 @@ class sitelinks $pref = e107::getPref(); $e107cache = e107::getCache(); - $usecache = ((trim(defset('LINKSTART_HILITE')) != "" || trim(defset('LINKCLASS_HILITE')) != "") ? false : true); + $usecache = (!(trim(defset('LINKSTART_HILITE')) != "" || trim(defset('LINKCLASS_HILITE')) != "")); if($usecache && !strpos(e_SELF, e_ADMIN) && ($data = $e107cache->retrieve('sitelinks_' . $cat . md5($linkstyle . e_PAGE . e_QUERY)))) { @@ -178,7 +178,7 @@ class sitelinks foreach($this->eLinkList['head_menu'] as $key => $link) { $main_linkid = "sub_" . $link['link_id']; - $link['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && empty($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ? true : false; + $link['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && empty($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])); $render_link[$key] = $this->makeLink($link, '', $style, $css_class); if(!defined("LINKSRENDERONLYMAIN") && !isset($style['linkmainonly'])) /* if this is defined in theme.php only main links will be rendered */ @@ -259,7 +259,7 @@ class sitelinks return null; } - $sub['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && empty($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ? TRUE : FALSE; + $sub['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && empty($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])); foreach($this->eLinkList[$main_linkid] as $val) // check that something in the submenu is actually selected. { @@ -280,7 +280,7 @@ class sitelinks foreach ($this->eLinkList[$main_linkid] as $sub) { $id = (!empty($sub['link_id'])) ? "sub_".$sub['link_id'] : 'sub_0'; - $sub['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && empty($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$id]) && is_array($this->eLinkList[$id])) ? TRUE : FALSE; + $sub['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && empty($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$id]) && is_array($this->eLinkList[$id])); $class = "sublink-level-".($level+1); $class .= ($css_class) ? " ".$css_class : ""; $class .= ($aSubStyle['sublinkclass']) ? " ".$aSubStyle['sublinkclass'] : ""; // backwards compatible @@ -529,7 +529,7 @@ class sitelinks { if($link_qry) { // plugin links with queries - return (strpos(e_SELF,$link_slf) && e_QUERY == $link_qry) ? TRUE : FALSE; + return (strpos(e_SELF, $link_slf) && e_QUERY == $link_qry); } else { // plugin links without queries @@ -553,7 +553,7 @@ class sitelinks if($qry[0] === "item") { - return ($qry[2] == $lnk[1]) ? TRUE : FALSE; + return $qry[2] == $lnk[1]; } if($qry[0] === "all" && $lnk[0] === "all") @@ -1590,7 +1590,7 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } $newArr = array(); foreach($ret as $row) { - $ignore = (!empty($opt['noempty']) && (empty($row['link_url']) || $row['link_url'] === '#')) ? true : false; + $ignore = (!empty($opt['noempty']) && (empty($row['link_url']) || $row['link_url'] === '#')); $tmp = (array) $row['link_sub']; diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index 60a10283f..9becaedcd 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -396,9 +396,7 @@ class e_theme $get = eHelper::removeTrackers($get); - $ret = empty($get) ? $site : $site.'?'.http_build_query($get); - - return $ret; + return empty($get) ? $site : $site.'?'.http_build_query($get); } @@ -901,7 +899,7 @@ class e_theme $vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0; $vars['preview'] = varset($vars['screenshots']['image']); $vars['thumbnail'] = isset($vars['preview'][0]) && file_exists(e_THEME.$path.'/'.$vars['preview'][0]) ? $vars['preview'][0] : ''; - $vars['html'] = file_exists(e_THEME.$path.'/theme.html') && is_dir(e_THEME.$path.'/layouts') ? true : false; + $vars['html'] = (file_exists(e_THEME . $path . '/theme.html') && is_dir(e_THEME . $path . '/layouts')); if(!empty($vars['themePrefs'])) @@ -997,7 +995,7 @@ class e_theme foreach($vars['stylesheets']['css'] as $val) { // $notadmin = vartrue($val['@attributes']['admin']) ? false : true; - $notadmin = (varset($val['@attributes']['scope']) !== 'admin') ? true : false; + $notadmin = varset($val['@attributes']['scope']) !== 'admin'; $vars['css'][] = array( "name" => $val['@attributes']['file'], @@ -2103,7 +2101,7 @@ class themeHandler foreach($theme['preview'] as $pic) { - $picFull = (substr($pic,0,4) == 'http') ? $pic : e_THEME.$theme['path']."/".$pic; + $picFull = (strpos($pic, 'http') === 0) ? $pic : e_THEME.$theme['path']."/".$pic; $text .= "