Godawful hack... we'll be frequently passed selected namespaces as strings since PHP is such a shithole.
But we also don't want blanks and nulls and "all"s matching 0, so let's convert *just* string ints to clean ints.
* (bug 12505) Fixed section=0 with action=raw
* Do not log user rights change that didn't change anything
* (bug 12584) Don't reset cl_timestamp when auto-updating sort key on move
+* (bug 12588) Fix selection in namespace selector on Special:Newpages
== Parser changes in 1.12 ==
$namespaces = $wgContLang->getFormattedNamespaces();
$options = array();
+ // Godawful hack... we'll be frequently passed selected namespaces
+ // as strings since PHP is such a shithole.
+ // But we also don't want blanks and nulls and "all"s matching 0,
+ // so let's convert *just* string ints to clean ints.
+ if( preg_match( '/^\d+$/', $selected ) ) {
+ $selected = intval( $selected );
+ }
+
if( !is_null( $all ) )
$namespaces = array( $all => wfMsg( 'namespacesall' ) ) + $namespaces;
foreach( $namespaces as $index => $name ) {