From: Glenn H. <thr...@us...> - 2005-12-18 17:11:23
|
Update of /cvsroot/mantisbt/mantisbt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29979/core Modified Files: Tag: BRANCH_1_0_0rc4 filter_api.php Log Message: fixed filter to handle numeric META_FILTER_ANY Index: filter_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/filter_api.php,v retrieving revision 1.122.2.2.2.3.2.2 retrieving revision 1.122.2.2.2.3.2.3 diff -u -d -r1.122.2.2.2.3.2.2 -r1.122.2.2.2.3.2.3 --- filter_api.php 18 Dec 2005 16:42:14 -0000 1.122.2.2.2.3.2.2 +++ filter_api.php 18 Dec 2005 17:11:15 -0000 1.122.2.2.2.3.2.3 @@ -261,7 +261,7 @@ $t_any_found = false; foreach( $t_filter['show_category'] as $t_filter_member ) { - if ( META_FILTER_ANY === $t_filter_member ) { + if ( ( META_FILTER_ANY == $t_filter_member ) && ( is_numeric( $t_filter_member ) ) ) { $t_any_found = true; } } @@ -420,7 +420,7 @@ # product build $t_any_found = false; foreach( $t_filter['show_build'] as $t_filter_member ) { - if ( ( META_FILTER_ANY == $t_filter_member ) || ( 0 === $t_filter_member ) ) { + if ( ( META_FILTER_ANY == $t_filter_member ) && ( is_numeric( $t_filter_member ) ) ) { $t_any_found = true; } } @@ -449,7 +449,7 @@ # product version $t_any_found = false; foreach( $t_filter['show_version'] as $t_filter_member ) { - if ( ( META_FILTER_ANY == $t_filter_member ) || ( 0 === $t_filter_member ) ) { + if ( ( META_FILTER_ANY == $t_filter_member ) && ( is_numeric( $t_filter_member ) ) ) { $t_any_found = true; } } @@ -523,7 +523,7 @@ # fixed in version $t_any_found = false; foreach( $t_filter['fixed_in_version'] as $t_filter_member ) { - if ( ( META_FILTER_ANY == $t_filter_member ) || ( 0 === $t_filter_member ) ) { + if ( ( META_FILTER_ANY == $t_filter_member ) && ( is_numeric( $t_filter_member ) ) ) { $t_any_found = true; } } @@ -1221,7 +1221,8 @@ <input type="hidden" name="show_category[]" value="<?php echo string_display( $t_current );?>" /> <?php $t_this_string = ''; - if ( ( $t_current === META_FILTER_ANY ) || ( is_blank( $t_current ) ) ) { + if ( ( ( $t_current == META_FILTER_ANY ) && ( is_numeric( $t_current ) ) ) + || ( is_blank( $t_current ) ) ) { $t_any_found = true; } else { $t_this_string = string_display( $t_current ); @@ -1469,7 +1470,8 @@ <input type="hidden" name="show_build[]" value="<?php echo string_display( $t_current );?>" /> <?php $t_this_string = ''; - if ( ( $t_current === META_FILTER_ANY ) || ( is_blank( $t_current ) ) ) { + if ( ( ( $t_current == META_FILTER_ANY ) && ( is_numeric( $t_current ) ) ) + || ( is_blank( $t_current ) ) ) { $t_any_found = true; } else if ( META_FILTER_NONE == $t_current ) { $t_this_string = lang_get( 'none' ); @@ -1506,7 +1508,8 @@ <input type="hidden" name="show_version[]" value="<?php echo string_display( $t_current );?>" /> <?php $t_this_string = ''; - if ( ( $t_current === META_FILTER_ANY ) || ( is_blank( $t_current ) ) ) { + if ( ( ( $t_current == META_FILTER_ANY ) && (is_numeric( $t_current ) ) ) + || ( is_blank( $t_current ) ) ) { $t_any_found = true; } else if ( META_FILTER_NONE == $t_current ) { $t_this_string = lang_get( 'none' ); @@ -1542,7 +1545,8 @@ <input type="hidden" name="fixed_in_version[]" value="<?php echo string_display( $t_current );?>" /> <?php $t_this_string = ''; - if ( ( $t_current === META_FILTER_ANY ) || ( is_blank( $t_current ) ) ) { + if ( ( ( $t_current == META_FILTER_ANY ) && ( is_numeric( $t_current ) ) ) + || ( is_blank( $t_current ) ) ) { $t_any_found = true; } else if ( META_FILTER_NONE == $t_current ) { $t_this_string = lang_get( 'none' ); @@ -1875,9 +1879,10 @@ foreach( $t_filter['custom_fields'][$t_accessible_custom_fields_ids[$i]] as $t_current ) { $t_current = stripslashes( $t_current ); $t_this_string = ''; - if ( ( $t_current === META_FILTER_ANY ) || ( $t_current === 0 ) ) { + if ( ( ( $t_current == META_FILTER_ANY ) && ( is_numeric( $t_current ) ) ) + || ( is_blank( $t_current ) ) ) { $t_any_found = true; - } else if ( META_FILTER_NONE == $t_current ) { + } else if ( ( META_FILTER_NONE == $t_current ) && ( is_numeric( $t_current ) ) ) { $t_this_string = lang_get( 'none' ); } else { $t_this_string = string_display( $t_current ); |