diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_update.php | 8 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 4 | ||||
-rw-r--r-- | phpBB/includes/hooks/index.php | 8 | ||||
-rw-r--r-- | phpBB/includes/session.php | 14 | ||||
-rw-r--r-- | phpBB/includes/template.php | 11 |
5 files changed, 31 insertions, 14 deletions
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index 03f2db7d15..1ab4726e8b 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * @package acp */ class acp_update diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 29512e0e51..4a3659c758 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1577,7 +1577,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) // Developers using the hook function need to globalise the $_SID and $_EXTRA_URL on their own and also handle it appropiatly. // They could mimick most of what is within this function - if ($phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id)) + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__, $url, $params, $is_amp, $session_id)) { if ($phpbb_hook->hook_return(__FUNCTION__)) { @@ -4463,7 +4463,7 @@ function phpbb_user_session_handler() { global $phpbb_hook; - if ($phpbb_hook->call_hook(__FUNCTION__)) + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__)) { if ($phpbb_hook->hook_return(__FUNCTION__)) { diff --git a/phpBB/includes/hooks/index.php b/phpBB/includes/hooks/index.php index a8ad64478a..aa85e63f32 100644 --- a/phpBB/includes/hooks/index.php +++ b/phpBB/includes/hooks/index.php @@ -1,10 +1,10 @@ <?php -/** +/** * * @package phpBB3 * @version $Id$ -* @copyright (c) 2007 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright (c) 2007 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ @@ -111,7 +111,7 @@ class phpbb_hook if (!empty($this->hooks[$class][$function])) { - // Developer tries to call a hooked function within the hooked function... + // Developer tries to call a hooked function within the hooked function... if ($this->current_hook !== NULL && $this->current_hook['class'] === $class && $this->current_hook['function'] === $function) { return false; diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index b2399c74c5..0d59bf8faf 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -9,6 +9,14 @@ */ /** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** * Session class * @package phpBB3 */ @@ -367,7 +375,7 @@ class session foreach ($active_bots as $row) { - if ($row['bot_agent'] && strpos(strtolower($this->browser), strtolower($row['bot_agent'])) !== false) + if ($row['bot_agent'] && preg_match('#' . str_replace('\*', '.*?', preg_quote($row['bot_agent'], '#')) . '#i', $this->browser)) { $bot = $row['user_id']; } @@ -644,7 +652,7 @@ class session $sql = 'SELECT COUNT(session_id) AS sessions FROM ' . SESSIONS_TABLE . ' - WHERE session_user_id = ' . (int) $this->data['user_id'] . ' + WHERE session_user_id = ' . (int) $this->data['user_id'] . ' AND session_time >= ' . ($this->time_now - $config['form_token_lifetime']); $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); @@ -837,7 +845,7 @@ class session $sql = 'SELECT DISTINCT c.session_id FROM ' . CONFIRM_TABLE . ' c LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id) - WHERE s.session_id IS NULL' . + WHERE s.session_id IS NULL' . ((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type); $result = $db->sql_query($sql); diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 4c126b8a91..2e60beb658 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -1,14 +1,15 @@ <?php -/** +/** * * @package phpBB3 * @version $Id$ * @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** +* @ignore */ if (!defined('IN_PHPBB')) { @@ -149,7 +150,7 @@ class template { global $user, $phpbb_hook; - if ($phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once)) + if (!empty($phpbb_hook) && $phpbb_hook->call_hook(array(__CLASS__, __FUNCTION__), $handle, $include_once)) { if ($phpbb_hook->hook_return(array(__CLASS__, __FUNCTION__))) { @@ -408,10 +409,10 @@ class template * * If key is false the position is set to 0 * If key is true the position is set to the last entry - * + * * @param string $mode Mode to execute (valid modes are 'insert' and 'change') * - * If insert, the vararray is inserted at the given position (position counting from zero). + * If insert, the vararray is inserted at the given position (position counting from zero). * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value). * * Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array) |