From: jenkins-bot Date: Fri, 18 Sep 2015 08:55:54 +0000 (+0000) Subject: Merge "Fix use of preg_match_all in MagicWord.php" X-Git-Tag: 1.31.0-rc.0~9977 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=c8f71fe5ddd1c2555b06cbc77e734d51e67ecebf;hp=fc07bedeb4675fbf022a948be3568680e34af25f;p=lhc%2Fweb%2Fwiklou.git Merge "Fix use of preg_match_all in MagicWord.php" --- diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 833f852715..2c7ba91bf2 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -950,10 +950,12 @@ class MagicWordArray { if ( $regex === '' ) { continue; } - preg_match_all( $regex, $text, $matches, PREG_SET_ORDER ); - foreach ( $matches as $m ) { - list( $name, $param ) = $this->parseMatch( $m ); - $found[$name] = $param; + $matches = array(); + if ( preg_match_all( $regex, $text, $matches, PREG_SET_ORDER ) ) { + foreach ( $matches as $m ) { + list( $name, $param ) = $this->parseMatch( $m ); + $found[$name] = $param; + } } $text = preg_replace( $regex, '', $text ); }