http://www.mediawiki.org/wiki/Special:Code/MediaWiki/56470

Revision: 56470
Author:   brion
Date:     2009-09-17 00:51:07 +0000 (Thu, 17 Sep 2009)

Log Message:
-----------
Revert r53832, r53897, r54145 "(bug 17988) Spaces before [[Category:]] links 
are no longer ignored" and followup
Causes entire page to go blank under some circumstances.

Modified Paths:
--------------
    branches/wmf-deployment/includes/parser/Parser.php

Modified: branches/wmf-deployment/includes/parser/Parser.php
===================================================================
--- branches/wmf-deployment/includes/parser/Parser.php  2009-09-17 00:38:40 UTC 
(rev 56469)
+++ branches/wmf-deployment/includes/parser/Parser.php  2009-09-17 00:51:07 UTC 
(rev 56470)
@@ -1726,7 +1726,7 @@
 
                                if ( $ns == NS_CATEGORY ) {
                                        wfProfileIn( __METHOD__."-category" );
-                                       $s = preg_replace( "/(\s*\n)+\s*$/D", 
'', $s ); # bug 87
+                                       $s = rtrim($s . "\n"); # bug 87
 
                                        if ( $wasblank ) {
                                                $sortkey = 
$this->getDefaultSort();
@@ -1742,7 +1742,7 @@
                                         * Strip the whitespace Category links 
produce, see bug 87
                                         * @todo We might want to use 
trim($tmp, "\n") here.
                                         */
-                                       $s .= trim( $prefix . $trail, "\n" ) == 
'' ? '' : $prefix . $trail;
+                                       $s .= trim($prefix . $trail, "\n") == 
'' ? '': $prefix . $trail;
 
                                        wfProfileOut( __METHOD__."-category" );
                                        continue;



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to