Skip to content

Commit db6b4ca

Browse files
author
epriestley
committedJan 14, 2020
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
1 parent 767528c commit db6b4ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎externals/porter-stemmer/src/Porter.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ private static function doubleConsonant($str)
402402
{
403403
$c = self::$regex_consonant;
404404

405-
return preg_match("#$c{2}$#", $str, $matches) AND $matches[0]{0} == $matches[0]{1};
405+
return preg_match("#$c{2}$#", $str, $matches) AND $matches[0][0] == $matches[0][1];
406406
}
407407

408408
/**
@@ -419,8 +419,8 @@ private static function cvc($str)
419419

420420
return preg_match("#($c$v$c)$#", $str, $matches)
421421
AND strlen($matches[1]) == 3
422-
AND $matches[1]{2} != 'w'
423-
AND $matches[1]{2} != 'x'
424-
AND $matches[1]{2} != 'y';
422+
AND $matches[1][2] != 'w'
423+
AND $matches[1][2] != 'x'
424+
AND $matches[1][2] != 'y';
425425
}
426426
}

0 commit comments

Comments
 (0)
Failed to load comments.