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...
dregad committed Jan 19, 2013
1 parent dbf923c commit 512a5af864a4ee9091e9653943c4dc1bafe9676d
Showing with 8 additions and 4 deletions.
  1. +8 −4 core/filter_api.php
View
@@ -3394,10 +3394,14 @@ function <?php echo $t_js_toggle_func;?>() {
<td class="small-caption" valign="top"><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" valign="top" 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 512a5af

Please sign in to comment.