From ba0fc4fa20067528effd4802e53ceeb959640825 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 12 Jan 2012 13:42:29 +0100 Subject: Update to MediaWiki 1.18.1 --- includes/parser/Parser.php | 22 ++++++++++------------ includes/parser/StripState.php | 7 +++++-- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'includes/parser') diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 8d4c60df..b6443fdb 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5207,20 +5207,18 @@ class Parser { if ( is_null( $this->mRevisionTimestamp ) ) { wfProfileIn( __METHOD__ ); - $revObject = $this->getRevisionObject(); - $timestamp = $revObject ? $revObject->getTimestamp() : false; + global $wgContLang; - if( $timestamp !== false ) { - global $wgContLang; + $revObject = $this->getRevisionObject(); + $timestamp = $revObject ? $revObject->getTimestamp() : wfTimestampNow(); - # The cryptic '' timezone parameter tells to use the site-default - # timezone offset instead of the user settings. - # - # Since this value will be saved into the parser cache, served - # to other users, and potentially even used inside links and such, - # it needs to be consistent for all visitors. - $this->mRevisionTimestamp = $wgContLang->userAdjust( $timestamp, '' ); - } + # The cryptic '' timezone parameter tells to use the site-default + # timezone offset instead of the user settings. + # + # Since this value will be saved into the parser cache, served + # to other users, and potentially even used inside links and such, + # it needs to be consistent for all visitors. + $this->mRevisionTimestamp = $wgContLang->userAdjust( $timestamp, '' ); wfProfileOut( __METHOD__ ); } diff --git a/includes/parser/StripState.php b/includes/parser/StripState.php index c7bd1e77..357dc2c8 100644 --- a/includes/parser/StripState.php +++ b/includes/parser/StripState.php @@ -90,10 +90,13 @@ class StripState { wfProfileIn( __METHOD__ ); $this->tempType = $type; - $out = preg_replace_callback( $this->regex, array( $this, 'unstripCallback' ), $text ); + do { + $oldText = $text; + $text = preg_replace_callback( $this->regex, array( $this, 'unstripCallback' ), $text ); + } while ( $text !== $oldText ); $this->tempType = null; wfProfileOut( __METHOD__ ); - return $out; + return $text; } /** -- cgit v1.2.3-54-g00ecf