Commit db6b4ca4 authored by epriestley's avatar epriestley
Browse files

Update deprecated array access syntax in Porter stemmer

Summary: Fixes T13472. This library uses `$a{0}`, but this is deprecated in favor of `$a[0]`.

Test Plan:
Ran `bin/search index Txxx --force` on a task with "filing" in the title (this term reaches the "m" rule of the stemmer).

(I'm not on new enough PHP for this to actually raise an error, but I'll follow up with the reporting user.)

Maniphest Tasks: T13472

Differential Revision:
parent 767528c0
......@@ -402,7 +402,7 @@ class Porter
$c = self::$regex_consonant;
return preg_match("#$c{2}$#", $str, $matches) AND $matches[0]{0} == $matches[0]{1};
return preg_match("#$c{2}$#", $str, $matches) AND $matches[0][0] == $matches[0][1];
......@@ -419,8 +419,8 @@ class Porter
return preg_match("#($c$v$c)$#", $str, $matches)
AND strlen($matches[1]) == 3
AND $matches[1]{2} != 'w'
AND $matches[1]{2} != 'x'
AND $matches[1]{2} != 'y';
AND $matches[1][2] != 'w'
AND $matches[1][2] != 'x'
AND $matches[1][2] != 'y';
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment