Permalink
Browse files

Display of match_type filter property for unknown types

Prior to this, if for any reason the filter's match type property was
not one of the predefined types (i.e. 'any' or 'all'), the code would
default to 'all', but display a blank string on the filter page. This is
confusing to users, so the display now matches the filter's actual
behavior.

Fixes #15389
  • Loading branch information...
1 parent 4362aa1 commit 5f641fc7bc2b6c618b0d056f7a210126e82e8e62 @dregad dregad committed Jan 19, 2013
Showing with 8 additions and 4 deletions.
  1. +8 −4 core/filter_api.php
View
@@ -3389,10 +3389,14 @@ function filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_e
<td class="small-caption"><a href="<?php echo $t_filters_url . FILTER_PROPERTY_MATCH_TYPE;?>" id="match_type_filter"><?php echo lang_get( 'filter_match_type' )?>:</a></td>
<td class="small-caption" id="match_type_filter_target">
<?php
- if ( $t_filter[FILTER_PROPERTY_MATCH_TYPE] == FILTER_MATCH_ANY ) {
- echo lang_get ('filter_match_any');
- } else if ( $t_filter[FILTER_PROPERTY_MATCH_TYPE] == FILTER_MATCH_ALL ) {
- echo lang_get ('filter_match_all');
+ switch( $t_filter[FILTER_PROPERTY_MATCH_TYPE] ) {
+ case FILTER_MATCH_ANY:
+ echo lang_get ('filter_match_any');
+ break;
+ case FILTER_MATCH_ALL:
+ default:
+ echo lang_get ('filter_match_all');
+ break;
}
?>
<input type="hidden" name="match_type" value="<?php echo $t_filter[FILTER_PROPERTY_MATCH_TYPE] ?>"/>

0 comments on commit 5f641fc

Please sign in to comment.