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:
8
externals/porter-stemmer/src/Porter.php
vendored
8
externals/porter-stemmer/src/Porter.php
vendored
@@ -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';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user