From: <jfi...@us...> - 2002-08-27 08:32:34
|
Update of /cvsroot/mantisbt/mantisbt/core In directory usw-pr-cvs1:/tmp/cvs-serv30147/core Modified Files: gpc_api.php Log Message: fix bug where the default value was being interpreted as a string instead of just being returned Index: gpc_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/gpc_api.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- gpc_api.php 25 Aug 2002 14:26:03 -0000 1.3 +++ gpc_api.php 27 Aug 2002 08:32:30 -0000 1.4 @@ -52,7 +52,9 @@ function gpc_get_bool( $p_var_name, $p_default = null ) { $t_result = gpc_get( $p_var_name, $p_default ); - if ( 0 == strcasecmp( 'off', $t_result ) || + if ( $t_result === $p_default ) { + return $p_default; + } else if ( 0 == strcasecmp( 'off', $t_result ) || 0 == strcasecmp( 'no', $t_result ) || 0 == strcasecmp( 'false', $t_result ) || 0 == strcasecmp( '0', $t_result ) ) { |