1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

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: https://secure.phabricator.com/D20941
This commit is contained in:
epriestley 2020-01-14 12:02:58 -08:00
parent 767528c0ed
commit db6b4ca480

View file

@ -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';
}
}