From: Brion Vibber Date: Thu, 17 Sep 2009 00:57:10 +0000 (+0000) Subject: Revert r53832, r53897, r54145 "(bug 17988) Spaces before [[Category:]] links are... X-Git-Tag: 1.31.0-rc.0~39696 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=63b39c91646fd9f8a357d38b1f9306e84616b7d5;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 85edf10eca..20af1c6a1a 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1726,7 +1726,7 @@ class Parser 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 @@ class Parser * 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;