From: jenkins-bot Date: Mon, 4 Feb 2019 17:57:00 +0000 (+0000) Subject: Merge "Prevent undesired toggling on Special:NewPages" X-Git-Tag: 1.34.0-rc.0~2949 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=51ef9b4337bbfdcadb960ffe4c1bff286208d188;hp=cc41493d64689a83d9cdac0943983ac15b68aa74;p=lhc%2Fweb%2Fwiklou.git Merge "Prevent undesired toggling on Special:NewPages" --- diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 8051b0b4e4..2bbc0bf486 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -192,9 +192,12 @@ class SpecialNewpages extends IncludableSpecialPage { // wfArrayToCgi(), called from LinkRenderer/Title, will not output null and false values // to the URL, which would omit some options (T158504). Fix it by explicitly setting them // to 0 or 1. - $changed = array_map( function ( $value ) { - return $value ? '1' : '0'; - }, $changed ); + // Also do this only for boolean options, not eg. namespace or tagfilter + foreach ( $changed as $key => $value ) { + if ( array_key_exists( $key, $filters ) ) { + $changed[$key] = $changed[$key] ? '1' : '0'; + } + } $self = $this->getPageTitle(); $linkRenderer = $this->getLinkRenderer();