mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
Reorder array checks
Make sure that `if (isset($arr['__phpseclib_marker']))` is done on an array only.
This commit is contained in:
parent
062aa41ba0
commit
94b669d7ed
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user