Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fall back to English when translated error string is missing

Fixes #16549
  • Loading branch information...
commit 994fa50d9f6475078b57e521a49ac6e3d75e857a 1 parent 4c4f1bc
@dregad dregad authored
Showing with 14 additions and 5 deletions.
  1. +14 −5 core/error_api.php
View
19 core/error_api.php
@@ -402,11 +402,20 @@ function error_build_parameter_string( $p_param, $p_showtype = true, $p_depth =
function error_string( $p_error ) {
global $g_error_parameters;
- $t_err_msg = lang_get( 'MANTIS_ERROR' );
- if( array_key_exists( $p_error, $t_err_msg) ) {
- $t_error = $t_err_msg[$p_error];
- } else {
- return lang_get( 'missing_error_string' ) . $p_error;
+ $t_lang = null;
+ while( true ) {
+ $t_err_msg = lang_get( 'MANTIS_ERROR', $t_lang );
+ if( array_key_exists( $p_error, $t_err_msg) ) {
+ $t_error = $t_err_msg[$p_error];
+ break;
+ } elseif( is_null( $t_lang ) ) {
+ # Error string not found, fall back to English
+ $t_lang = 'english';
+ } else {
+ # Error string not found
+ $t_error = lang_get( 'missing_error_string' );
+ break;
+ }
}
# We pad the parameter array to make sure that we don't get errors if
Please sign in to comment.
Something went wrong with that request. Please try again.