Strict checks for I18n::loadLocaleDefinition().

This commit is contained in:
Phally 2013-09-01 06:20:53 +02:00
parent 4f91465af7
commit f4929c1b04

View file

@ -549,10 +549,10 @@ class I18n {
continue; continue;
} }
$count = count($parts); $count = count($parts);
if ($count == 2) { if ($count === 2) {
$currentToken = $parts[0]; $currentToken = $parts[0];
$value = $parts[1]; $value = $parts[1];
} elseif ($count == 1) { } elseif ($count === 1) {
$value = is_array($value) ? $parts[0] : $value . $parts[0]; $value = is_array($value) ? $parts[0] : $value . $parts[0];
} else { } else {
continue; continue;
@ -575,7 +575,7 @@ class I18n {
$val = str_replace($replacements, $mustEscape, $val); $val = str_replace($replacements, $mustEscape, $val);
$value[$i] = $val; $value[$i] = $val;
} }
if (count($value) == 1) { if (count($value) === 1) {
$definitions[$currentToken] = array_pop($value); $definitions[$currentToken] = array_pop($value);
} else { } else {
$definitions[$currentToken] = $value; $definitions[$currentToken] = $value;