# HG changeset patch # User Dan # Date 1242411382 14400 # Node ID 888502d761b45cb5b95bcaead5cc5b2430e16bbf # Parent d13fad911955ca3a6cb33e2a1208371dd7b27e2d Added minor edit filter to Special:Log diff -r d13fad911955 -r 888502d761b4 language/english/tools.json --- a/language/english/tools.json Fri May 15 14:03:54 2009 -0400 +++ b/language/english/tools.json Fri May 15 14:16:22 2009 -0400 @@ -178,6 +178,9 @@ form_filtertype_within: 'Within', form_filtertype_page: 'Page', form_filtertype_action: 'Action', + form_filtertype_minor: 'Minor edit', + form_filtertype_minor_yes: 'Show only minor edits', + form_filtertype_minor_no: 'Hide minor edits', formaction_rename: 'Rename', formaction_create: 'Create page', formaction_delete: 'Delete page', diff -r d13fad911955 -r 888502d761b4 plugins/SpecialLog.php --- a/plugins/SpecialLog.php Fri May 15 14:03:54 2009 -0400 +++ b/plugins/SpecialLog.php Fri May 15 14:16:22 2009 -0400 @@ -62,18 +62,21 @@ $value = strval(intval($_POST['value']['within'])) . $_POST['value']['withinunits']; else $value = $_POST['value'][$type]; - - $value = str_replace('/', '.2f', sanitize_page_id($value)); - - if ( empty($value) || ( $type == 'within' && intval($value) == 0 ) ) + + if ( !ctype_digit($value) ) + $value = str_replace('/', '.2f', sanitize_page_id($value)); + + if ( $value !== '0' && (empty($value) || ( $type == 'within' && intval($value) == 0 )) ) { $adderror = $lang->get('log_err_addfilter_field_empty'); } - - $append = ( !empty($_POST['existing_filters']) ) ? "{$_POST['existing_filters']}/" : ''; - $url = makeUrlNS('Special', "Log/{$append}{$type}={$value}"); - - redirect($url, '', '', 0); + else + { + $append = ( !empty($_POST['existing_filters']) ) ? "{$_POST['existing_filters']}/" : ''; + $url = makeUrlNS('Special', "Log/{$append}{$type}={$value}"); + + redirect($url, '', '', 0); + } } $params = explode('/', $params); foreach ( $params as $i => $param ) @@ -210,6 +213,7 @@ + @@ -239,6 +243,16 @@ +
+ + +
@@ -322,6 +336,9 @@ $action = ( $lang->get("log_formaction_{$value}") === "log_formaction_{$value}" ) ? $lang->get("log_action_{$value}") : $lang->get("log_formaction_{$value}"); $crumb = $lang->get('log_breadcrumb_action', array('action' => htmlspecialchars($action))); break; + case 'minor': + $crumb = $value == '1' ? $lang->get('log_form_filtertype_minor_yes') : $lang->get('log_form_filtertype_minor_no'); + break; case 'within': $value = intval($value); if ( $value % 31536000 == 0 )