Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 1366f3f

Browse files
author
Ben Batschelet
committed
Fix calls to count() on (potentially) uncountable values.
1 parent c0a643f commit 1366f3f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

library/Zend/Cache/Frontend/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ protected function _makePartialId($arrayName, $bool1, $bool2)
395395
}
396396
return '';
397397
}
398-
if (count($var) > 0) {
398+
if (is_array($var) && count($var) > 0) {
399399
return false;
400400
}
401401
return '';

library/Zend/Config/Yaml.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,11 @@ protected static function _parseValue($value)
362362
$value = trim($value);
363363

364364
// remove quotes from string.
365-
if ('"' == $value['0']) {
366-
if ('"' == $value[count($value) -1]) {
365+
if ('"' == substr($value, 0, 1)) {
366+
if ('"' == substr($value, -1)) {
367367
$value = substr($value, 1, -1);
368368
}
369-
} elseif ('\'' == $value['0'] && '\'' == $value[count($value) -1]) {
369+
} elseif ('\'' == substr($value, 0, 1) && '\'' == substr($value, -1)) {
370370
$value = strtr($value, array("''" => "'", "'" => ''));
371371
}
372372

0 commit comments

Comments
 (0)