Minor fix in gettext loop for max string lenght

This commit is contained in:
Clemens Schwaighofer
2022-04-14 13:43:26 +09:00
parent 82bc99b181
commit c830a32962

View File

@@ -353,7 +353,8 @@ class GetTextReader
$expr .= ';'; $expr .= ';';
$res = ''; $res = '';
$p = 0; $p = 0;
for ($i = 0; $i < strlen($expr); $i++) { $expr_len = strlen($expr);
for ($i = 0; $i < $expr_len; $i++) {
$ch = $expr[$i]; $ch = $expr[$i];
switch ($ch) { switch ($ch) {
case '?': case '?':
@@ -433,6 +434,7 @@ class GetTextReader
$total = 0; $total = 0;
$plural = 0; $plural = 0;
// FIXME use Symfony\Component\ExpressionLanguage\ExpressionLanguage or similar
eval("$string"); eval("$string");
/** @phpstan-ignore-next-line 0 >= 0 is always true*/ /** @phpstan-ignore-next-line 0 >= 0 is always true*/
if ($plural >= $total) { if ($plural >= $total) {