summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2014-01-03 23:05:29 +0100
committerPierre Schmitz <pierre@archlinux.de>2014-01-03 23:05:29 +0100
commit9937b8e6d6a8b4517c04c143daaf9ebd42ce8ba0 (patch)
tree9f1186eaed683ea412b8833d0e12a3dace012732
parent4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (diff)
Make MagicWordArray compatible with PCRE 8.34+
See https://git.wikimedia.org/commit/mediawiki%2Fcore.git/b9f291e8cd5bb1450f7b1031aa17cf7775aa7e96
-rw-r--r--includes/MagicWord.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/MagicWord.php b/includes/MagicWord.php
index 427a1adc..232f43e8 100644
--- a/includes/MagicWord.php
+++ b/includes/MagicWord.php
@@ -709,7 +709,9 @@ class MagicWordArray {
$magic = MagicWord::get( $name );
$case = intval( $magic->isCaseSensitive() );
foreach ( $magic->getSynonyms() as $i => $syn ) {
- $group = "(?P<{$i}_{$name}>" . preg_quote( $syn, '/' ) . ')';
+ // Group name must start with a non-digit in PCRE 8.34+
+ $it = strtr( $i, '0123456789', 'abcdefghij' );
+ $group = "(?P<{$it}_{$name}>" . preg_quote( $syn, '/' ) . ')';
if ( $this->baseRegex[$case] === '' ) {
$this->baseRegex[$case] = $group;
} else {