From: <gi...@ma...> - 2010-03-26 23:45:20
|
The branch, master has been updated via f39d92fcb23b7f6f68dd6a1e90702412e26f5dc3 (commit) from cfc8737fc6d20d667d1054de10d0b2bf4ef3b85f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f39d92fcb23b7f6f68dd6a1e90702412e26f5dc3 Author: David Hicks <hic...@op...> Date: Fri Mar 26 23:43:17 2010 +1100 Incorrect logic in check_selected() The check_selected() function fails when the first argument is an array of strings and the second argument is an integer, float or boolean value. This patch resolves incorrect logic that led to a === type safe comparison between a string and another type. Obviously if we know the two types don't match, there is no point doing a type safe comparison on the two variables! ----------------------------------------------------------------------- Summary of changes: core/helper_api.php | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) ----------------------------------------------------------------------- commit f39d92fcb23b7f6f68dd6a1e90702412e26f5dc3 Author: David Hicks <hic...@op...> Date: Fri Mar 26 23:43:17 2010 +1100 Incorrect logic in check_selected() The check_selected() function fails when the first argument is an array of strings and the second argument is an integer, float or boolean value. This patch resolves incorrect logic that led to a === type safe comparison between a string and another type. Obviously if we know the two types don't match, there is no point doing a type safe comparison on the two variables! diff --git a/core/helper_api.php b/core/helper_api.php index 79bce1e..21b23d7 100644 --- a/core/helper_api.php +++ b/core/helper_api.php @@ -145,7 +145,7 @@ function check_selected( $p_var, $p_val = true ) { foreach( $p_var as $t_this_var ) { # catch the case where one entry is 0 and the other is a string. - if(( is_string( $t_this_var ) && !is_string( $p_val ) ) ) { + if( is_string( $t_this_var ) && is_string( $p_val ) ) { if( $t_this_var === $p_val ) { echo ' selected="selected" '; return; ----------------------------------------------------------------------- -- Mantis Bug Tracker |