User:Dandavis/Restricted Namespaces

From Meta, a Wikimedia project coordination wiki

For those interested, I have updated the Restricted Namespaces patches for v.1.7.1. I made a once over and didn't find anything major busted... but, if you use 'em and find something wrong, let me know please. :)

Get 'em here: http://bugzilla.wikimedia.org/attachment.cgi?id=2082

One thing, and maybe someone here can fill me in, I was not able to integrate a snippet from an earlier version of the patch into Parser.php. If you can tell me where/how this should fit in to the 1.7.1 code, I would appreciate it... or, if you can tell me that it's not needed, that's even better!

***************
*** 2527,2532 ****
--- 2537,2546 ----
               if ( !$found ) {
                       # Check for NS: (namespace expansion)
                       $mwNs = MagicWord::get( MAG_NS );
+                         if ( $part1 == 'ns' ) {
+                                 $text = $linestart .
$wgContLang->getNsText( $this->mTitle->getNamespace() );
+                                 $found = true;
+                         }
                       if ( $mwNs->matchStartAndRemove( $part1 ) ) {
                               if ( intval( $part1 ) || $part1 == "0" ) {
                                       $text = $linestart .
$wgContLang->getNsText( intval( $part1 ) );
***************