From d6bae9f79cfe7c238d6a3e1a618b09cdef93f6ea Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 6 Oct 2011 00:07:45 +0000 Subject: [PATCH] Fix for bug 31374: reintroduce recursive unstrip as in r27667, somehow omitted during the refactor in r82645. StripState::merge() is still wrong, but it's currently unused on Wikimedia, so this will do as a temporary patch. --- includes/parser/StripState.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/parser/StripState.php b/includes/parser/StripState.php index c7bd1e77d9..357dc2c8bf 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; } /** -- 2.20.1