CMS 2.0
This commit is contained in:
@@ -34,7 +34,7 @@ class CachingIterator extends \CachingIterator implements \Countable
|
||||
public function __construct(iterable|\stdClass $iterable)
|
||||
{
|
||||
$iterable = $iterable instanceof \stdClass
|
||||
? new \ArrayIterator($iterable)
|
||||
? new \ArrayIterator((array) $iterable)
|
||||
: Nette\Utils\Iterables::toIterator($iterable);
|
||||
parent::__construct($iterable, 0);
|
||||
}
|
||||
|
||||
2
vendor/nette/utils/src/Utils/Arrays.php
vendored
2
vendor/nette/utils/src/Utils/Arrays.php
vendored
@@ -533,7 +533,7 @@ class Arrays
|
||||
*/
|
||||
public static function toKey(mixed $value): int|string
|
||||
{
|
||||
return key([$value => null]);
|
||||
return key(@[$value => null]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
8
vendor/nette/utils/src/Utils/Image.php
vendored
8
vendor/nette/utils/src/Utils/Image.php
vendored
@@ -239,8 +239,8 @@ class Image
|
||||
*/
|
||||
public static function detectTypeFromFile(string $file, &$width = null, &$height = null): ?int
|
||||
{
|
||||
[$width, $height, $type] = @getimagesize($file); // @ - files smaller than 12 bytes causes read error
|
||||
return isset(self::Formats[$type]) ? $type : null;
|
||||
[$width, $height, $type] = Helpers::falseToNull(@getimagesize($file)); // @ - files smaller than 12 bytes causes read error
|
||||
return $type && isset(self::Formats[$type]) ? $type : null;
|
||||
}
|
||||
|
||||
|
||||
@@ -250,8 +250,8 @@ class Image
|
||||
*/
|
||||
public static function detectTypeFromString(string $s, &$width = null, &$height = null): ?int
|
||||
{
|
||||
[$width, $height, $type] = @getimagesizefromstring($s); // @ - strings smaller than 12 bytes causes read error
|
||||
return isset(self::Formats[$type]) ? $type : null;
|
||||
[$width, $height, $type] = Helpers::falseToNull(@getimagesizefromstring($s)); // @ - strings smaller than 12 bytes causes read error
|
||||
return $type && isset(self::Formats[$type]) ? $type : null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user