1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-30 04:39:02 +01:00

Reorder array checks

Make sure that `if (isset($arr['__phpseclib_marker']))` is done on an array only.
This commit is contained in:
Joey3000 2016-02-16 20:45:05 +01:00
parent 062aa41ba0
commit 94b669d7ed

View File

@ -275,13 +275,13 @@ if (!function_exists('phpseclib_safe_serialize')) {
if (is_object($arr)) {
return '';
}
if (!is_array($arr)) {
return serialize($arr);
}
// prevent circular array recursion
if (isset($arr['__phpseclib_marker'])) {
return '';
}
if (!is_array($arr)) {
return serialize($arr);
}
$safearr = array();
$arr['__phpseclib_marker'] = true;
foreach (array_keys($arr) as $key) {