From 63b39c91646fd9f8a357d38b1f9306e84616b7d5 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 17 Sep 2009 00:57:10 +0000 Subject: [PATCH] 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. --- includes/parser/Parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1