Skip to content

Commit

Permalink
Define new ERROR_TYPE_MISMATCH
Browse files Browse the repository at this point in the history
This is to replace the use of ERROR_GENERIC when performing a strict
type comparison in helper_check_variables_equal() function.

Fixes #16474
  • Loading branch information
dregad committed Oct 12, 2013
1 parent d712ad3 commit 034b165
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/constant_inc.php
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion core/helper_api.php
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lang/strings_english.txt
Expand Up @@ -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.';

0 comments on commit 034b165

Please sign in to comment.