Loading sources/database.php +1 −1 Original line number Diff line number Diff line Loading @@ -1710,7 +1710,7 @@ class DatabaseConnector // Optimisation: Load language fields in advance so we don't need to do additional details when calling get_translated_* functions $lang_strings_expecting = array(); if ($lang_fields !== null) { if (!empty($lang_fields)) { if (multi_lang_content()) { if ((strpos($query, 'text_original') !== false) || (function_exists('user_lang')) && ((is_null($start)) || ($start < 200))) { $lang = function_exists('user_lang') ? user_lang() : get_site_default_lang(); // We can we assume this, as we will cache against it -- if subsequently code wants something else it'd be a cache miss which is fine Loading sources/failure.php +9 −3 Original line number Diff line number Diff line Loading @@ -560,7 +560,7 @@ function _log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_ if (($ip2 == $ip) || ($ip2 == '') || (cms_srv('SERVER_ADDR') == $ip2)) { $ip2 = null; } if (function_exists('get_member')) { if ((function_exists('get_member')) && (!$GLOBALS['BOOTSTRAPPING'])) { $id = get_member(); $username = $GLOBALS['FORUM_DRIVER']->get_username($id); if (is_null($username)) { Loading @@ -568,7 +568,7 @@ function _log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_ } } else { $id = db_get_first_id(); $username = function_exists('do_lang') ? do_lang('UNKNOWN') : 'Unknown'; $username = ((function_exists('do_lang')) && (!$GLOBALS['BOOTSTRAPPING'])) ? do_lang('UNKNOWN') : 'Unknown'; } $url = cms_srv('REQUEST_URI'); Loading Loading @@ -689,7 +689,7 @@ function _log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_ $GLOBALS['SITE_DB']->query_insert('hackattack', $new_row); } if (function_exists('do_lang')) { if ((function_exists('do_lang')) && (!$GLOBALS['BOOTSTRAPPING'])) { require_code('notifications'); $reason_full = do_lang($reason, $reason_param_a, $reason_param_b, null, get_site_default_lang()); Loading Loading @@ -734,12 +734,18 @@ function _log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_ if ($silent) { return; } if ((function_exists('do_lang')) && (!$GLOBALS['BOOTSTRAPPING'])) { if ($GLOBALS['DEV_MODE']) { fatal_exit(do_lang('HACK_ATTACK')); } warn_exit(do_lang_tempcode('HACK_ATTACK_USER')); } require_code('critical_errors'); critical_error('EMERGENCY', 'Suspected hack attempt averted'); } /** * Add an IP-ban. * Loading Loading
sources/database.php +1 −1 Original line number Diff line number Diff line Loading @@ -1710,7 +1710,7 @@ class DatabaseConnector // Optimisation: Load language fields in advance so we don't need to do additional details when calling get_translated_* functions $lang_strings_expecting = array(); if ($lang_fields !== null) { if (!empty($lang_fields)) { if (multi_lang_content()) { if ((strpos($query, 'text_original') !== false) || (function_exists('user_lang')) && ((is_null($start)) || ($start < 200))) { $lang = function_exists('user_lang') ? user_lang() : get_site_default_lang(); // We can we assume this, as we will cache against it -- if subsequently code wants something else it'd be a cache miss which is fine Loading
sources/failure.php +9 −3 Original line number Diff line number Diff line Loading @@ -560,7 +560,7 @@ function _log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_ if (($ip2 == $ip) || ($ip2 == '') || (cms_srv('SERVER_ADDR') == $ip2)) { $ip2 = null; } if (function_exists('get_member')) { if ((function_exists('get_member')) && (!$GLOBALS['BOOTSTRAPPING'])) { $id = get_member(); $username = $GLOBALS['FORUM_DRIVER']->get_username($id); if (is_null($username)) { Loading @@ -568,7 +568,7 @@ function _log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_ } } else { $id = db_get_first_id(); $username = function_exists('do_lang') ? do_lang('UNKNOWN') : 'Unknown'; $username = ((function_exists('do_lang')) && (!$GLOBALS['BOOTSTRAPPING'])) ? do_lang('UNKNOWN') : 'Unknown'; } $url = cms_srv('REQUEST_URI'); Loading Loading @@ -689,7 +689,7 @@ function _log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_ $GLOBALS['SITE_DB']->query_insert('hackattack', $new_row); } if (function_exists('do_lang')) { if ((function_exists('do_lang')) && (!$GLOBALS['BOOTSTRAPPING'])) { require_code('notifications'); $reason_full = do_lang($reason, $reason_param_a, $reason_param_b, null, get_site_default_lang()); Loading Loading @@ -734,12 +734,18 @@ function _log_hack_attack_and_exit($reason, $reason_param_a = '', $reason_param_ if ($silent) { return; } if ((function_exists('do_lang')) && (!$GLOBALS['BOOTSTRAPPING'])) { if ($GLOBALS['DEV_MODE']) { fatal_exit(do_lang('HACK_ATTACK')); } warn_exit(do_lang_tempcode('HACK_ATTACK_USER')); } require_code('critical_errors'); critical_error('EMERGENCY', 'Suspected hack attempt averted'); } /** * Add an IP-ban. * Loading