Used substr_compare instead of substr when we don't care about result

This commit is contained in:
Alexander Makarov
2014-07-23 16:37:49 +04:00
parent 5c767e5d34
commit 07f01bcf2b
14 changed files with 21 additions and 21 deletions

View File

@ -333,7 +333,7 @@ class MessageController extends Controller
ksort($translated);
foreach ($translated as $message => $translation) {
if (!isset($merged[$message]) && !isset($todo[$message]) && !$removeUnused) {
if (substr($translation, 0, 2) === '@@' && substr($translation, -2) === '@@') {
if (substr_compare($translation, '@@', 0, 2) === 0 && substr_compare($translation, '@@', -2) === 0) {
$todo[$message] = $translation;
} else {
$todo[$message] = '@@' . $translation . '@@';