summaryrefslogtreecommitdiff
path: root/includes/MagicWord.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-17 09:15:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-17 09:44:51 +0100
commita1789ddde42033f1b05cc4929491214ee6e79383 (patch)
tree63615735c4ddffaaabf2428946bb26f90899f7bf /includes/MagicWord.php
parent9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff)
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/MagicWord.php')
-rw-r--r--includes/MagicWord.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/includes/MagicWord.php b/includes/MagicWord.php
index 186821de..2c7ba91b 100644
--- a/includes/MagicWord.php
+++ b/includes/MagicWord.php
@@ -718,9 +718,6 @@ class MagicWordArray {
private $regex;
- /** @todo Unused? */
- private $matches;
-
/**
* @param array $names
*/
@@ -953,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 );
}