mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-28 12:10:59 +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)) {
|
if (is_object($arr)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
if (!is_array($arr)) {
|
||||||
|
return serialize($arr);
|
||||||
|
}
|
||||||
// prevent circular array recursion
|
// prevent circular array recursion
|
||||||
if (isset($arr['__phpseclib_marker'])) {
|
if (isset($arr['__phpseclib_marker'])) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
if (!is_array($arr)) {
|
|
||||||
return serialize($arr);
|
|
||||||
}
|
|
||||||
$safearr = array();
|
$safearr = array();
|
||||||
$arr['__phpseclib_marker'] = true;
|
$arr['__phpseclib_marker'] = true;
|
||||||
foreach (array_keys($arr) as $key) {
|
foreach (array_keys($arr) as $key) {
|
||||||
|
Loading…
Reference in New Issue
Block a user