diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_captcha.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 2 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_apache.php | 9 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_db.php | 9 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_ldap.php | 9 | ||||
-rw-r--r-- | phpBB/includes/constants.php | 4 | ||||
-rw-r--r-- | phpBB/includes/db/dbal.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 36 | ||||
-rw-r--r-- | phpBB/includes/functions_convert.php | 2 |
9 files changed, 59 insertions, 20 deletions
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 7386c378a3..496f66e4f9 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -46,7 +46,7 @@ class acp_captcha } $captcha = new captcha(); $captcha->execute(gen_rand_string(mt_rand(5, 8)), time()); - exit; + exit_handler(); } $config_vars = array( diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index fd2602d329..41991fdae0 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -41,7 +41,7 @@ class acp_forums $total = request_var('total', 0); $this->display_progress_bar($start, $total); - exit; + exit_handler(); break; case 'delete': diff --git a/phpBB/includes/auth/auth_apache.php b/phpBB/includes/auth/auth_apache.php index 4c8293c707..25631e9f87 100644 --- a/phpBB/includes/auth/auth_apache.php +++ b/phpBB/includes/auth/auth_apache.php @@ -36,6 +36,15 @@ function login_apache(&$username, &$password) { global $db; + // do not allow empty password + if (!$password) + { + return array( + 'status' => LOGIN_BREAK, + 'error_msg' => 'NO_PASSWORD_SUPPLIED', + ); + } + if (!isset($_SERVER['PHP_AUTH_USER'])) { return array( diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index 6df378b00a..49e6b8fc5d 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -20,6 +20,15 @@ function login_db(&$username, &$password) { global $db, $config; + // do not allow empty password + if (!$password) + { + return array( + 'status' => LOGIN_BREAK, + 'error_msg' => 'NO_PASSWORD_SUPPLIED', + ); + } + $sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts FROM ' . USERS_TABLE . " WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index a4e6365183..7f79a4862a 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -92,6 +92,15 @@ function login_ldap(&$username, &$password) { global $db, $config, $user; + // do not allow empty password + if (!$password) + { + return array( + 'status' => LOGIN_BREAK, + 'error_msg' => 'NO_PASSWORD_SUPPLIED', + ); + } + if (!@extension_loaded('ldap')) { return array( diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 3c049a1153..0823074072 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -9,6 +9,10 @@ */ /** +* valid external constants: +* PHPBB_MSG_HANDLER +* PHPBB_ROOT_PATH +* PHPBB_ADMIN_PATH */ // User related diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 79a2d6bf35..f79b196e68 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -651,8 +651,10 @@ class dbal </div> </body> </html>'; - exit; - break; + + exit_handler(); + + break; case 'stop': $endtime = explode(' ', microtime()); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 142b1e8ce7..9f75438e84 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1577,6 +1577,8 @@ function on_page($num_items, $per_page, $start) * append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=1&f=2', false); * append_sid("{$phpbb_root_path}viewtopic.$phpEx", array('t' => 1, 'f' => 2)); * </code> +* +* Ability to use own function <code>append_sid_phpbb_hook</code> as a hook. It is called in favor of this function. */ function append_sid($url, $params = false, $is_amp = true, $session_id = false) { @@ -2107,12 +2109,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa trigger_error('NO_AUTH_ADMIN_USER_DIFFER'); } - // do not allow empty password - if (!$password) - { - trigger_error('NO_PASSWORD_SUPPLIED'); - } - // If authentication is successful we redirect user to previous page $result = $auth->login($username, $password, $autologin, $viewonline, $admin); @@ -3572,8 +3568,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', } else { - $profile_url = ($custom_profile_url !== false) ? $custom_profile_url : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile'); - $profile_url .= '&u=' . (int) $user_id; + $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&u=' . (int) $user_id : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id); } } else @@ -3794,7 +3789,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) echo '</body>'; echo '</html>'; - exit; + exit_handler(); break; case E_USER_WARNING: @@ -3853,7 +3848,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) page_footer(); } - exit; + exit_handler(); break; } @@ -4303,11 +4298,7 @@ function page_footer($run_cron = true) $template->display('body'); garbage_collection(); - - if (!defined('PHPBB_EMBEDDED')) - { - exit; - } + exit_handler(); } /** @@ -4332,6 +4323,21 @@ function garbage_collection() } /** +* Handler for exit calls in phpBB +* +* Ability to use own function <code>exit_handler_phpbb_hook</code> as a hook. It is called in favor of this function. +*/ +function exit_handler() +{ + if (function_exists('exit_handler_phpbb_hook')) + { + return exit_handler_phpbb_hook(); + } + + exit; +} + +/** * @package phpBB3 */ class bitfield diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 12b3109430..a5f78f5c2d 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1784,7 +1784,7 @@ function add_bots() 'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''), 'Francis [Bot]' => array('http://www.neomo.de/', ''), 'Gigabot [Bot]' => array('Gigabot/', ''), - 'Google Adsense [Bot]' => array('Mediapartners-Google/', ''), + 'Google Adsense [Bot]' => array('Mediapartners-Google', ''), 'Google Desktop' => array('Google Desktop', ''), 'Google Feedfetcher' => array('Feedfetcher-Google', ''), 'Google [Bot]' => array('Googlebot', ''), |