Per Simetrical's comment on r53832: only trim if there're newlines
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 28 Jul 2009 20:16:17 +0000 (20:16 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 28 Jul 2009 20:16:17 +0000 (20:16 +0000)
includes/parser/Parser.php

index aaf848f..ad4d732 100644 (file)
@@ -1705,7 +1705,7 @@ class Parser
 
                                if ( $ns == NS_CATEGORY ) {
                                        wfProfileIn( __METHOD__."-category" );
-                                       $s = rtrim( $s, "\n" ); # bug 87
+                                       $s = preg_replace( "/(\s*\n)+\s*$/m", '', $s ); # bug 87
 
                                        if ( $wasblank ) {
                                                $sortkey = $this->getDefaultSort();