diff --git a/admin/admin_attachments.php b/admin/admin_attachments.php index d3ad9b8be..a33aea7d7 100644 --- a/admin/admin_attachments.php +++ b/admin/admin_attachments.php @@ -151,7 +151,9 @@ if ($search_imagick) { if (preg_match('/convert/i', $imagick)) { return true; - } elseif ($imagick != 'none') { + } + + if ($imagick != 'none') { if (!preg_match('/WIN/i', PHP_OS)) { $retval = @exec('whereis convert'); $paths = explode(' ', $retval); diff --git a/admin/admin_forums.php b/admin/admin_forums.php index 5db193ece..cb7b37ce7 100644 --- a/admin/admin_forums.php +++ b/admin/admin_forums.php @@ -584,7 +584,9 @@ if ($mode) { if ($forum_info['forum_parent'] && $prev_forum['forum_parent'] != $forum_info['forum_parent']) { $show_main_page = true; break; - } elseif ($move_down_forum_id = get_prev_root_forum_id($forums, $forum_order)) { + } + + if ($move_down_forum_id = get_prev_root_forum_id($forums, $forum_order)) { $move_up_forum_id = $forum_id; $move_down_ord_val = (get_sf_count($forum_id) + 1) * 10; $move_up_ord_val = ((get_sf_count($move_down_forum_id) + 1) * 10) + $move_down_ord_val; @@ -595,7 +597,9 @@ if ($mode) { if ($forum_info['forum_parent'] && $next_forum['forum_parent'] != $forum_info['forum_parent']) { $show_main_page = true; break; - } elseif ($move_up_forum_id = get_next_root_forum_id($forums, $forum_order)) { + } + + if ($move_up_forum_id = get_next_root_forum_id($forums, $forum_order)) { $move_down_forum_id = $forum_id; $move_down_forum_order = $forum_order; $move_down_ord_val = (get_sf_count($move_up_forum_id) + 1) * 10; diff --git a/common.php b/common.php index 104fca3e1..f8dd24ed3 100644 --- a/common.php +++ b/common.php @@ -268,9 +268,9 @@ function mkdir_rec($path, $mode) { if (is_dir($path)) { return ($path !== '.' && $path !== '..') ? is_writable($path) : false; - } else { - return (mkdir_rec(dirname($path), $mode)) ? @mkdir($path, $mode) : false; } + + return (mkdir_rec(dirname($path), $mode)) ? @mkdir($path, $mode) : false; } function verify_id($id, $length) @@ -342,40 +342,42 @@ function bencode($var) { if (is_string($var)) { return strlen($var) . ':' . $var; - } elseif (is_int($var)) { + } + + if (is_int($var)) { return 'i' . $var . 'e'; } elseif (is_float($var)) { return 'i' . sprintf('%.0f', $var) . 'e'; } elseif (is_array($var)) { if (count($var) == 0) { return 'de'; - } else { - $assoc = false; + } - foreach ($var as $key => $val) { - if (!is_int($key)) { - $assoc = true; - break; - } - } + $assoc = false; - if ($assoc) { - ksort($var, SORT_REGULAR); - $ret = 'd'; - - foreach ($var as $key => $val) { - $ret .= bencode($key) . bencode($val); - } - return $ret . 'e'; - } else { - $ret = 'l'; - - foreach ($var as $val) { - $ret .= bencode($val); - } - return $ret . 'e'; + foreach ($var as $key => $val) { + if (!is_int($key)) { + $assoc = true; + break; } } + + if ($assoc) { + ksort($var, SORT_REGULAR); + $ret = 'd'; + + foreach ($var as $key => $val) { + $ret .= bencode($key) . bencode($val); + } + return $ret . 'e'; + } + + $ret = 'l'; + + foreach ($var as $val) { + $ret .= bencode($val); + } + return $ret . 'e'; } else { trigger_error('bencode error: wrong data type', E_USER_ERROR); } diff --git a/dl.php b/dl.php index df1dbbe87..d612915df 100644 --- a/dl.php +++ b/dl.php @@ -198,27 +198,27 @@ if ($download_mode == PHYSICAL_LINK) { $url = make_url($upload_dir . '/' . $attachment['physical_filename']); header('Location: ' . $url); exit; -} else { - if (IS_GUEST && !bb_captcha('check')) { - global $template; - - $redirect_url = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/'); - $message = '
'; - $message .= $lang['CAPTCHA'] . ':'; - $message .= '
' . bb_captcha('get') . '
'; - $message .= ''; - $message .= '  '; - $message .= ''; - $message .= '
'; - - $template->assign_vars(array( - 'ERROR_MESSAGE' => $message, - )); - - require(PAGE_HEADER); - require(PAGE_FOOTER); - } - - send_file_to_browser($attachment, $upload_dir); - exit; } + +if (IS_GUEST && !bb_captcha('check')) { + global $template; + + $redirect_url = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/'); + $message = '
'; + $message .= $lang['CAPTCHA'] . ':'; + $message .= '
' . bb_captcha('get') . '
'; + $message .= ''; + $message .= '  '; + $message .= ''; + $message .= '
'; + + $template->assign_vars(array( + 'ERROR_MESSAGE' => $message, + )); + + require(PAGE_HEADER); + require(PAGE_FOOTER); +} + +send_file_to_browser($attachment, $upload_dir); +exit; diff --git a/library/ajax/view_torrent.php b/library/ajax/view_torrent.php index c9274178a..5707683ea 100644 --- a/library/ajax/view_torrent.php +++ b/library/ajax/view_torrent.php @@ -88,9 +88,9 @@ class TorrentFileList } $filelist = $html->array2html($this->files_ary); return "
{$this->root_dir}
$filelist"; - } else { - return join('', $this->files_ary['/']); } + + return join('', $this->files_ary['/']); } private function build_filelist_array() diff --git a/library/attach_mod/attachment_mod.php b/library/attach_mod/attachment_mod.php index d587b489f..b04009974 100644 --- a/library/attach_mod/attachment_mod.php +++ b/library/attach_mod/attachment_mod.php @@ -47,11 +47,11 @@ function attach_mod_get_lang($language_file) $file = LANG_ROOT_DIR . '/' . $bb_cfg['default_lang'] . '/' . $language_file . '.php'; if (file_exists($file)) { return $bb_cfg['default_lang']; - } else { - $file = LANG_ROOT_DIR . '/' . $attach_config['board_lang'] . '/' . $language_file . '.php'; - if (file_exists($file)) { - return $attach_config['board_lang']; - } + } + + $file = LANG_ROOT_DIR . '/' . $attach_config['board_lang'] . '/' . $language_file . '.php'; + if (file_exists($file)) { + return $attach_config['board_lang']; } bb_die('Attachment mod language file does not exist: language/' . $attach_config['board_lang'] . '/' . $language_file . '.php'); diff --git a/library/attach_mod/includes/functions_attach.php b/library/attach_mod/includes/functions_attach.php index 82145d92c..19924163b 100644 --- a/library/attach_mod/includes/functions_attach.php +++ b/library/attach_mod/includes/functions_attach.php @@ -49,7 +49,9 @@ function base64_pack($number) if ($number > 4096) { return; - } elseif ($number < $base) { + } + + if ($number < $base) { return $chars[$number]; } @@ -133,7 +135,9 @@ function auth_unpack($auth_cache) if ($forum_auth == $one_char_encoding) { $auth_len = 1; continue; - } elseif ($forum_auth == $two_char_encoding) { + } + + if ($forum_auth == $two_char_encoding) { $auth_len = 2; $pos--; continue; @@ -166,7 +170,9 @@ function is_forum_authed($auth_cache, $check_forum_id) if ($forum_auth == $one_char_encoding) { $auth_len = 1; continue; - } elseif ($forum_auth == $two_char_encoding) { + } + + if ($forum_auth == $two_char_encoding) { $auth_len = 2; $pos--; continue; @@ -210,9 +216,9 @@ function attachment_exists($filename) if (!@file_exists(@amod_realpath($upload_dir . '/' . $filename))) { return false; - } else { - return true; } + + return true; } /** @@ -226,9 +232,9 @@ function thumbnail_exists($filename) if (!@file_exists(@amod_realpath($upload_dir . '/' . THUMB_DIR . '/t_' . $filename))) { return false; - } else { - return true; } + + return true; } /** @@ -412,9 +418,9 @@ function get_extension($filename) $extension = strtolower(trim($extension)); if (is_array($extension)) { return ''; - } else { - return $extension; } + + return $extension; } /** @@ -544,9 +550,9 @@ function attach_mod_sql_escape($text) { if (function_exists('mysqli_real_escape_string')) { return DB()->escape_string($text); - } else { - return str_replace("'", "''", str_replace('\\', '\\\\', $text)); } + + return str_replace("'", "''", str_replace('\\', '\\\\', $text)); } /** diff --git a/library/attach_mod/includes/functions_thumbs.php b/library/attach_mod/includes/functions_thumbs.php index fea9f9963..1dd510a00 100644 --- a/library/attach_mod/includes/functions_thumbs.php +++ b/library/attach_mod/includes/functions_thumbs.php @@ -42,12 +42,12 @@ function get_img_size_format($width, $height) round($width * ($max_width / $width)), round($height * ($max_width / $width)) ); - } else { - return array( - round($width * ($max_width / $height)), - round($height * ($max_width / $height)) - ); } + + return array( + round($width * ($max_width / $height)), + round($height * ($max_width / $height)) + ); } /** @@ -60,9 +60,9 @@ function is_imagick() if ($attach_config['img_imagick'] != '') { $imagick = $attach_config['img_imagick']; return true; - } else { - return false; } + + return false; } /** diff --git a/library/includes/bbcode.php b/library/includes/bbcode.php index d84cd671f..fef2431f9 100644 --- a/library/includes/bbcode.php +++ b/library/includes/bbcode.php @@ -394,12 +394,12 @@ function add_search_words($post_id, $post_message, $topic_title = '', $only_retu if ($only_return_words || $bb_cfg['search_engine_type'] == 'sphinx') { return join("\n", $words); - } else { - DB()->query("DELETE FROM " . BB_POSTS_SEARCH . " WHERE post_id = $post_id"); + } - if ($words_sql = DB()->escape(join("\n", $words))) { - DB()->query("REPLACE INTO " . BB_POSTS_SEARCH . " (post_id, search_words) VALUES ($post_id, '$words_sql')"); - } + DB()->query("DELETE FROM " . BB_POSTS_SEARCH . " WHERE post_id = $post_id"); + + if ($words_sql = DB()->escape(join("\n", $words))) { + DB()->query("REPLACE INTO " . BB_POSTS_SEARCH . " (post_id, search_words) VALUES ($post_id, '$words_sql')"); } } diff --git a/library/includes/cache/apc.php b/library/includes/cache/apc.php index da475beb3..69b5544f8 100644 --- a/library/includes/cache/apc.php +++ b/library/includes/cache/apc.php @@ -74,9 +74,9 @@ class cache_apc extends cache_common $this->num_queries++; return apc_delete($this->prefix . $name); - } else { - return apc_clear_cache(); } + + return apc_clear_cache(); } public function is_installed() diff --git a/library/includes/cache/memcache.php b/library/includes/cache/memcache.php index 6a3dc3269..12c2d0d4c 100644 --- a/library/includes/cache/memcache.php +++ b/library/includes/cache/memcache.php @@ -115,9 +115,9 @@ class cache_memcache extends cache_common $this->num_queries++; return ($this->connected) ? $this->memcache->delete($this->prefix . $name, 0) : false; - } else { - return ($this->connected) ? $this->memcache->flush() : false; } + + return ($this->connected) ? $this->memcache->flush() : false; } public function is_installed() diff --git a/library/includes/cache/redis.php b/library/includes/cache/redis.php index 64598fabb..2561981c3 100644 --- a/library/includes/cache/redis.php +++ b/library/includes/cache/redis.php @@ -99,9 +99,9 @@ class cache_redis extends cache_common $this->num_queries++; return true; - } else { - return false; } + + return false; } public function rm($name = '') @@ -118,9 +118,9 @@ class cache_redis extends cache_common $this->num_queries++; return ($this->connected) ? $this->redis->del($this->prefix . $name) : false; - } else { - return ($this->connected) ? $this->redis->flushdb() : false; } + + return ($this->connected) ? $this->redis->flushdb() : false; } public function is_installed() diff --git a/library/includes/cache/sqlite.php b/library/includes/cache/sqlite.php index f7fed7456..31581b355 100644 --- a/library/includes/cache/sqlite.php +++ b/library/includes/cache/sqlite.php @@ -90,9 +90,9 @@ class cache_sqlite extends cache_common // return if (is_array($this->prefix . $name)) { return $cached_items; - } else { - return isset($cached_items[$name]) ? $cached_items[$name] : false; } + + return isset($cached_items[$name]) ? $cached_items[$name] : false; } public function set($name, $value, $ttl = 604800) diff --git a/library/includes/cache/xcache.php b/library/includes/cache/xcache.php index f762c43ac..6811ff0f9 100644 --- a/library/includes/cache/xcache.php +++ b/library/includes/cache/xcache.php @@ -74,11 +74,11 @@ class cache_xcache extends cache_common $this->num_queries++; return xcache_unset($this->prefix . $name); - } else { - xcache_clear_cache(XC_TYPE_PHP, 0); - xcache_clear_cache(XC_TYPE_VAR, 0); - return; } + + xcache_clear_cache(XC_TYPE_PHP, 0); + xcache_clear_cache(XC_TYPE_VAR, 0); + return; } public function is_installed() diff --git a/library/includes/classes/sitemap.php b/library/includes/classes/sitemap.php index 5290117aa..52ba4c8c3 100644 --- a/library/includes/classes/sitemap.php +++ b/library/includes/classes/sitemap.php @@ -212,9 +212,9 @@ class sitemap curl_close($ch); return $data; - } else { - return @file_get_contents($file); } + + return @file_get_contents($file); } public function create() diff --git a/library/includes/core/caches.php b/library/includes/core/caches.php index 46e48fd54..c74a31f0a 100644 --- a/library/includes/core/caches.php +++ b/library/includes/core/caches.php @@ -116,9 +116,9 @@ class caches { if (!empty($cfg['shard_type']) && $cfg['shard_type'] != 'none') { return $this->cfg['db_dir'] . $name . '_*' . $ext; - } else { - return $this->cfg['db_dir'] . $name . $ext; } + + return $this->cfg['db_dir'] . $name . $ext; } public function get_table_schema($cfg) diff --git a/library/includes/core/mysql.php b/library/includes/core/mysql.php index 69b0b3a24..6b9fd0354 100644 --- a/library/includes/core/mysql.php +++ b/library/includes/core/mysql.php @@ -241,9 +241,9 @@ class sql_db } } return $result; - } else { - return false; } + + return false; } /** @@ -274,9 +274,9 @@ class sql_db if ($field_name) { return isset($row[$field_name]) ? $row[$field_name] : false; - } else { - return $row; } + + return $row; } /** @@ -570,9 +570,9 @@ class sql_db { if ($this->link) { return ['code' => mysqli_errno($this->link), 'message' => mysqli_error($this->link)]; - } else { - return ['code' => '', 'message' => 'not connected']; } + + return ['code' => '', 'message' => 'not connected']; } /** diff --git a/library/includes/functions.php b/library/includes/functions.php index 0953a4190..7925d052d 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -926,9 +926,9 @@ function bt_show_ip($ip, $port = '') $ip = decode_ip($ip); $ip .= ($port) ? ":$port" : ''; return $ip; - } else { - return ($bb_cfg['bt_show_ip_only_moder']) ? false : decode_ip_xx($ip); } + + return ($bb_cfg['bt_show_ip_only_moder']) ? false : decode_ip_xx($ip); } function bt_show_port($port) @@ -937,9 +937,9 @@ function bt_show_port($port) if (IS_AM) { return $port; - } else { - return ($bb_cfg['bt_show_port_only_moder']) ? false : $port; } + + return ($bb_cfg['bt_show_port_only_moder']) ? false : $port; } function decode_ip_xx($ip) @@ -1080,10 +1080,10 @@ function get_username($user_id) $usernames[$row['user_id']] = $row['username']; } return $usernames; - } else { - $row = DB()->fetch_row("SELECT username FROM " . BB_USERS . " WHERE user_id = $user_id LIMIT 1"); - return $row['username']; } + + $row = DB()->fetch_row("SELECT username FROM " . BB_USERS . " WHERE user_id = $user_id LIMIT 1"); + return $row['username']; } function get_user_id($username) @@ -1185,9 +1185,9 @@ function get_attachments_dir($cfg = null) if ($cfg['upload_dir'][0] == '/' || ($cfg['upload_dir'][0] != '/' && $cfg['upload_dir'][1] == ':')) { return $cfg['upload_dir']; - } else { - return BB_ROOT . $cfg['upload_dir']; } + + return BB_ROOT . $cfg['upload_dir']; } function bb_get_config($table, $from_db = false, $update_cache = true) @@ -2458,18 +2458,18 @@ function gender_image($gender) if (!$bb_cfg['gender']) { $user_gender = ''; return $user_gender; - } else { - switch ($gender) { - case MALE: - $user_gender = '' . $lang['GENDER_SELECT'][MALE] . ''; - break; - case FEMALE: - $user_gender = '' . $lang['GENDER_SELECT'][FEMALE] . ''; - break; - default: - $user_gender = '' . $lang['GENDER_SELECT'][NOGENDER] . ''; - break; - } + } + + switch ($gender) { + case MALE: + $user_gender = '' . $lang['GENDER_SELECT'][MALE] . ''; + break; + case FEMALE: + $user_gender = '' . $lang['GENDER_SELECT'][FEMALE] . ''; + break; + default: + $user_gender = '' . $lang['GENDER_SELECT'][NOGENDER] . ''; + break; } return $user_gender; @@ -2482,18 +2482,18 @@ function is_gold($type) if (!$tr_cfg['gold_silver_enabled']) { $is_gold = ''; return $is_gold; - } else { - switch ($type) { - case TOR_TYPE_GOLD: - $is_gold = ' '; - break; - case TOR_TYPE_SILVER: - $is_gold = ' '; - break; - default: - $is_gold = ''; - break; - } + } + + switch ($type) { + case TOR_TYPE_GOLD: + $is_gold = ' '; + break; + case TOR_TYPE_SILVER: + $is_gold = ' '; + break; + default: + $is_gold = ''; + break; } return $is_gold; diff --git a/library/includes/functions_atom.php b/library/includes/functions_atom.php index a0ecf1e46..113e7b3a7 100644 --- a/library/includes/functions_atom.php +++ b/library/includes/functions_atom.php @@ -97,9 +97,9 @@ function update_forum_feed($forum_id, $forum_data) } if (create_atom($file_path, 'f', $forum_id, htmlCHR($forum_data['forum_name']), $topics)) { return true; - } else { - return false; } + + return false; } function update_user_feed($user_id, $username) @@ -143,9 +143,9 @@ function update_user_feed($user_id, $username) } if (create_atom($file_path, 'u', $user_id, wbr($username), $topics)) { return true; - } else { - return false; } + + return false; } function create_atom($file_path, $mode, $id, $title, $topics) diff --git a/library/includes/functions_torrent.php b/library/includes/functions_torrent.php index 4cb1b9ae6..4b7a83395 100644 --- a/library/includes/functions_torrent.php +++ b/library/includes/functions_torrent.php @@ -590,9 +590,9 @@ function get_registered_torrents($id, $mode) if ($rowset = @DB()->sql_fetchrowset($result)) { return $rowset; - } else { - return false; } + + return false; } function torrent_error_exit($message) @@ -693,7 +693,9 @@ function bdecode_r($str, &$pos) if (($pos < 0) || ($pos >= $strlen)) { return null; - } elseif ($str[$pos] == 'i') { + } + + if ($str[$pos] == 'i') { $pos++; $numlen = strspn($str, '-0123456789', $pos); $spos = $pos; @@ -701,10 +703,10 @@ function bdecode_r($str, &$pos) if (($pos >= $strlen) || ($str[$pos] != 'e')) { return null; - } else { - $pos++; - return floatval(substr($str, $spos, $numlen)); } + + $pos++; + return floatval(substr($str, $spos, $numlen)); } elseif ($str[$pos] == 'd') { $pos++; $ret = array(); @@ -713,20 +715,22 @@ function bdecode_r($str, &$pos) if ($str[$pos] == 'e') { $pos++; return $ret; - } else { - $key = bdecode_r($str, $pos); + } - if ($key === null) { - return null; - } else { - $val = bdecode_r($str, $pos); + $key = bdecode_r($str, $pos); - if ($val === null) { - return null; - } elseif (!is_array($key)) { - $ret[$key] = $val; - } - } + if ($key === null) { + return null; + } + + $val = bdecode_r($str, $pos); + + if ($val === null) { + return null; + } + + if (!is_array($key)) { + $ret[$key] = $val; } } return null; @@ -738,15 +742,15 @@ function bdecode_r($str, &$pos) if ($str[$pos] == 'e') { $pos++; return $ret; - } else { - $val = bdecode_r($str, $pos); - - if ($val === null) { - return null; - } else { - $ret[] = $val; - } } + + $val = bdecode_r($str, $pos); + + if ($val === null) { + return null; + } + + $ret[] = $val; } return null; } else { @@ -756,17 +760,17 @@ function bdecode_r($str, &$pos) if (($pos >= $strlen) || ($str[$pos] != ':')) { return null; - } else { - $vallen = intval(substr($str, $spos, $numlen)); - $pos++; - $val = substr($str, $pos, $vallen); - - if (strlen($val) != $vallen) { - return null; - } else { - $pos += $vallen; - return $val; - } } + + $vallen = intval(substr($str, $spos, $numlen)); + $pos++; + $val = substr($str, $pos, $vallen); + + if (strlen($val) != $vallen) { + return null; + } + + $pos += $vallen; + return $val; } } diff --git a/library/includes/functions_upload.php b/library/includes/functions_upload.php index e15af4044..df11c5cf0 100644 --- a/library/includes/functions_upload.php +++ b/library/includes/functions_upload.php @@ -135,7 +135,9 @@ class upload_common delete_avatar($params['user_id'], $params['avatar_ext_id']); $file_path = get_avatar_path($params['user_id'], $this->file_ext_id); return $this->_move($file_path); - } elseif ($mode == 'attach') { + } + + if ($mode == 'attach') { $file_path = get_attach_path($params['topic_id']); return $this->_move($file_path); } else { diff --git a/library/includes/functions_validate.php b/library/includes/functions_validate.php index 2530945d2..06afd8945 100644 --- a/library/includes/functions_validate.php +++ b/library/includes/functions_validate.php @@ -40,7 +40,9 @@ function validate_username($username, $check_ban_and_taken = true) // Length if (mb_strlen($username, 'UTF-8') > USERNAME_MAX_LENGTH) { return $lang['USERNAME_TOO_LONG']; - } elseif (mb_strlen($username, 'UTF-8') < USERNAME_MIN_LENGTH) { + } + + if (mb_strlen($username, 'UTF-8') < USERNAME_MIN_LENGTH) { return $lang['USERNAME_TOO_SMALL']; } // Allowed symbols @@ -110,9 +112,9 @@ function validate_email($email, $check_ban_and_taken = true) if ($row = DB()->fetch_row("SELECT `user_email` FROM " . BB_USERS . " WHERE user_email = '$email_sql' LIMIT 1")) { if ($row['user_email'] == $userdata['user_email']) { return false; - } else { - return $lang['EMAIL_TAKEN']; } + + return $lang['EMAIL_TAKEN']; } } diff --git a/library/includes/sessions.php b/library/includes/sessions.php index 21a0ee9d3..936243ecf 100644 --- a/library/includes/sessions.php +++ b/library/includes/sessions.php @@ -400,7 +400,9 @@ class user_common cache_update_userdata($this->data); return $this->data; - } elseif ($new_session_userdata = $this->session_create($userdata, false)) { + } + + if ($new_session_userdata = $this->session_create($userdata, false)) { // Removing guest sessions from this IP DB()->query(" DELETE FROM " . BB_SESSIONS . " @@ -486,7 +488,9 @@ class user_common if ($expire_check) { if ($create_new && !$autologin_id) { return $this->create_autologin_id($userdata); - } elseif ($autologin_id && $userdata['user_session_time'] && $bb_cfg['max_autologin_time']) { + } + + if ($autologin_id && $userdata['user_session_time'] && $bb_cfg['max_autologin_time']) { if (TIMENOW - $userdata['user_session_time'] > $bb_cfg['max_autologin_time'] * 86400) { return $this->create_autologin_id($userdata, $create_new); } diff --git a/library/includes/template.php b/library/includes/template.php index a2351c624..65dc4219f 100644 --- a/library/includes/template.php +++ b/library/includes/template.php @@ -175,9 +175,9 @@ class template // Check if it's an absolute or relative path. if ((substr($filename, 0, 1) !== '/') && (substr($filename, 1, 1) !== ':')) { return $this->root . '/' . $filename; - } else { - return $filename; } + + return $filename; } /** @@ -216,9 +216,9 @@ class template if (!$this->files[$handle]) { if ($xs_include || $quiet) { return false; - } else { - die("Template->make_filename(): Error - invalid template $filename"); } + + die("Template->make_filename(): Error - invalid template $filename"); } // creating cache filename if ($can_cache) { @@ -520,9 +520,9 @@ class template $blockcount = sizeof($blocks) - 1; if ($include_last_iterator) { return '$' . $blocks[$blockcount] . '_item'; - } else { - return '$' . $blocks[$blockcount - 1] . '_item[\'' . $blocks[$blockcount] . '.\']'; } + + return '$' . $blocks[$blockcount - 1] . '_item[\'' . $blocks[$blockcount] . '.\']'; } public function compile_code($filename, $code)