From 034b1655bf5a8121014c22dfbc6f9483ed0c3c81 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Sat, 12 Oct 2013 19:41:08 +0200 Subject: [PATCH] Define new ERROR_TYPE_MISMATCH This is to replace the use of ERROR_GENERIC when performing a strict type comparison in helper_check_variables_equal() function. Fixes #16474 --- core/constant_inc.php | 1 + core/helper_api.php | 2 +- lang/strings_english.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/constant_inc.php b/core/constant_inc.php index e1ed660bdf..4b555efeb2 100644 --- a/core/constant_inc.php +++ b/core/constant_inc.php @@ -236,6 +236,7 @@ define( 'ERROR_DEPRECATED_SUPERSEDED', 23 ); define( 'ERROR_INVALID_RESOLUTION', 24 ); define( 'ERROR_DISPLAY_USER_ERROR_INLINE', 25 ); +define( 'ERROR_TYPE_MISMATCH', 26 ); # ERROR_CONFIG_* define( 'ERROR_CONFIG_OPT_NOT_FOUND', 100 ); diff --git a/core/helper_api.php b/core/helper_api.php index eb923ed68a..97088e458b 100644 --- a/core/helper_api.php +++ b/core/helper_api.php @@ -188,7 +188,7 @@ function helper_check_variables_equal( $p_var1, $p_var2, $p_strict ) { if ( gettype( $p_var1 ) !== gettype( $p_var2 ) ) { # Reaching this point is a a sign that you need to check the types # of the parameters passed to this function. They should match. - trigger_error( ERROR_GENERIC, ERROR ); + trigger_error( ERROR_TYPE_MISMATCH, ERROR ); } # We need to be careful when comparing an array of diff --git a/lang/strings_english.txt b/lang/strings_english.txt index 23b64ee6d7..531c776518 100644 --- a/lang/strings_english.txt +++ b/lang/strings_english.txt @@ -1683,3 +1683,4 @@ $MANTIS_ERROR[ERROR_INVALID_RESOLUTION] = 'Resolution "%1$s" is not allowed for $MANTIS_ERROR[ERROR_UPDATING_TIMEZONE] = 'Unable to update timezone.'; $MANTIS_ERROR[ERROR_DEPRECATED_SUPERSEDED] = 'Deprecated functionality: "%1$s", use "%2$s" instead.'; $MANTIS_ERROR[ERROR_DISPLAY_USER_ERROR_INLINE] = 'WARNING: System is configured to display MantisBT errors (E_USER_ERROR) inline. Program execution will continue; this may lead to system/data integrity issues.'; +$MANTIS_ERROR[ERROR_TYPE_MISMATCH] = 'Data Type mismatch. Enable detailed error messages for further information.';