diff options
author | asperous <theandychase@gmail.com> | 2013-04-23 09:55:36 -0700 |
---|---|---|
committer | asperous <theandychase@gmail.com> | 2013-04-23 09:55:36 -0700 |
commit | 9f545a7f6ba7ddd54fae083563b5b582e05f5c1c (patch) | |
tree | 1f10dd793aabb7cfc3e99fbb7c10437d9dc779b7 | |
parent | ab628cbdb99eda1c3efbbca7e374f64876800428 (diff) | |
download | forums-9f545a7f6ba7ddd54fae083563b5b582e05f5c1c.tar forums-9f545a7f6ba7ddd54fae083563b5b582e05f5c1c.tar.gz forums-9f545a7f6ba7ddd54fae083563b5b582e05f5c1c.tar.bz2 forums-9f545a7f6ba7ddd54fae083563b5b582e05f5c1c.tar.xz forums-9f545a7f6ba7ddd54fae083563b5b582e05f5c1c.zip |
[ticket/9975] Moved a few E_USER_ERROR errors to /language
There were a few error messages that a user could experience that would, previously, be without any the ability to be localized. There are some more E_USER_ERRORs that I did not change to a constant, for example the error message that is displayed if there aren't any folders in /language.
PHPBB3-9975
-rw-r--r-- | phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 6 | ||||
-rw-r--r-- | phpBB/includes/user.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/captcha_recaptcha.php | 1 | ||||
-rw-r--r-- | phpBB/language/en/common.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/mcp.php | 2 | ||||
-rw-r--r-- | phpBB/mcp.php | 2 | ||||
-rw-r--r-- | tests/security/redirect_test.php | 6 |
8 files changed, 14 insertions, 9 deletions
diff --git a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php index 83d40bbba7..cb21b04ec5 100644 --- a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php @@ -270,7 +270,7 @@ class phpbb_recaptcha extends phpbb_default_captcha $response = ''; if (false == ($fs = @fsockopen($host, $port, $errno, $errstr, 10))) { - trigger_error('Could not open socket', E_USER_ERROR); + trigger_error('RECAPTCHA_SOCKET_ERROR', E_USER_ERROR); } fwrite($fs, $http_request); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 58d2ad4760..6b5d7bd1df 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2731,7 +2731,7 @@ function redirect($url, $return = false, $disable_cd_check = false) // Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2 if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false) { - trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR); + trigger_error('INSECURE_REDIRECT', E_USER_ERROR); } // Now, also check the protocol and for a valid url the last time... @@ -2740,7 +2740,7 @@ function redirect($url, $return = false, $disable_cd_check = false) if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols)) { - trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR); + trigger_error('INSECURE_REDIRECT', E_USER_ERROR); } if ($return) @@ -4182,7 +4182,7 @@ function phpbb_checkdnsrr($host, $type = 'MX') // Handler, header and footer /** -* Error and message handler, call with trigger_error if reqd +* Error and message handler, call with trigger_error if read */ function msg_handler($errno, $msg_text, $errfile, $errline) { diff --git a/phpBB/includes/user.php b/phpBB/includes/user.php index 9ddd806b27..4477c98097 100644 --- a/phpBB/includes/user.php +++ b/phpBB/includes/user.php @@ -215,7 +215,7 @@ class phpbb_user extends phpbb_session if (!$this->style) { - trigger_error('Could not get style data', E_USER_ERROR); + trigger_error('STYLE_NOT_FOUND', E_USER_ERROR); } // Now parse the cfg file and cache it diff --git a/phpBB/language/en/captcha_recaptcha.php b/phpBB/language/en/captcha_recaptcha.php index c72957ca16..3d91a9d110 100644 --- a/phpBB/language/en/captcha_recaptcha.php +++ b/phpBB/language/en/captcha_recaptcha.php @@ -46,4 +46,5 @@ $lang = array_merge($lang, array( 'RECAPTCHA_PRIVATE_EXPLAIN' => 'Your private reCaptcha key. Keys can be obtained on <a href="http://www.google.com/recaptcha">www.google.com/recaptcha</a>.', 'RECAPTCHA_EXPLAIN' => 'In an effort to prevent automatic submissions, we require that you enter both of the words displayed into the text field underneath.', + 'RECAPTCHA_SOCKET_ERROR' => 'There was a problem connecting to the RECAPTCHA service: could not open socket. Try again later.', )); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 5d6fe03b5f..c2db496437 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -313,6 +313,7 @@ $lang = array_merge($lang, array( 'IN' => 'in', 'INDEX' => 'Index page', 'INFORMATION' => 'Information', + 'INSECURE_REDIRECT' => 'Tried to redirect to potentially insecure url.', 'INTERESTS' => 'Interests', 'INVALID_DIGEST_CHALLENGE' => 'Invalid digest challenge.', 'INVALID_EMAIL_LOG' => '<strong>%s</strong> possibly an invalid email address?', @@ -638,6 +639,7 @@ $lang = array_merge($lang, array( 'STATISTICS' => 'Statistics', 'START_WATCHING_FORUM' => 'Subscribe forum', 'START_WATCHING_TOPIC' => 'Subscribe topic', + 'STYLE_NOT_FOUND' => 'Could not get style data', 'STOP_WATCHING_FORUM' => 'Unsubscribe forum', 'STOP_WATCHING_TOPIC' => 'Unsubscribe topic', 'SUBFORUM' => 'Subforum', diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index eaa2d7e3a5..29f418183f 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -250,6 +250,8 @@ $lang = array_merge($lang, array( 'ONLY_TOPIC' => 'Only topic ā%sā', 'OTHER_USERS' => 'Other users posting from this IP', + 'QUICKMOD_ACTION_NOT_ALLOWED' => "%s not allowed as quickmod", + 'PM_REPORT_CLOSED_SUCCESS' => 'The selected PM report has been closed successfully.', 'PM_REPORT_DELETED_SUCCESS' => 'The selected PM report has been deleted successfully.', 'PM_REPORTED_SUCCESS' => 'This private message has been successfully reported.', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index d04a297cf9..c36faad74b 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -182,7 +182,7 @@ if ($quickmod) break; default: - trigger_error("$action not allowed as quickmod", E_USER_ERROR); + trigger_error($user->lang('QUICKMOD_ACTION_NOT_ALLOWED', $action), E_USER_ERROR); break; } } diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php index 1325466137..8e36780ca4 100644 --- a/tests/security/redirect_test.php +++ b/tests/security/redirect_test.php @@ -18,11 +18,11 @@ class phpbb_security_redirect_test extends phpbb_security_test_base // array(Input -> redirect(), expected triggered error (else false), expected returned result url (else false)) return array( array('data://x', false, 'http://localhost/phpBB'), - array('bad://localhost/phpBB/index.php', 'Tried to redirect to potentially insecure url.', false), + array('bad://localhost/phpBB/index.php', 'INSECURE_REDIRECT', false), array('http://www.otherdomain.com/somescript.php', false, 'http://localhost/phpBB'), - array("http://localhost/phpBB/memberlist.php\n\rConnection: close", 'Tried to redirect to potentially insecure url.', false), + array("http://localhost/phpBB/memberlist.php\n\rConnection: close", 'INSECURE_REDIRECT', false), array('javascript:test', false, 'http://localhost/phpBB/../javascript:test'), - array('http://localhost/phpBB/index.php;url=', 'Tried to redirect to potentially insecure url.', false), + array('http://localhost/phpBB/index.php;url=', 'INSECURE_REDIRECT', false), ); } |