Skip to content

Commit

Permalink
fix filter to handle numeric META_FILTER_ANY better
Browse files Browse the repository at this point in the history
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@3938 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
thraxisp committed Dec 18, 2005
1 parent 850e40b commit 1ab8cd5
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions core/filter_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: filter_api.php,v 1.132 2005-12-18 16:42:55 thraxisp Exp $
# $Id: filter_api.php,v 1.133 2005-12-18 17:14:28 thraxisp Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -280,7 +280,7 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
$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;
}
}
Expand Down Expand Up @@ -439,7 +439,7 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
# 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;
}
}
Expand Down Expand Up @@ -468,7 +468,7 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
# 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;
}
}
Expand Down Expand Up @@ -542,7 +542,7 @@ function filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p
# 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;
}
}
Expand Down Expand Up @@ -1272,7 +1272,8 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e
<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 );
Expand Down Expand Up @@ -1520,7 +1521,8 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e
<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' );
Expand Down Expand Up @@ -1557,7 +1559,8 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e
<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' );
Expand Down Expand Up @@ -1593,7 +1596,8 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e
<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' );
Expand Down Expand Up @@ -1926,9 +1930,10 @@ function <?php echo $t_js_toggle_func ; ?>() {
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 );
Expand Down

0 comments on commit 1ab8cd5

Please sign in to comment.