Skip to content

Commit 2af0509

Browse files
committed
fix the wrong usage of xlog when second parameter is not an array
1 parent 03378b0 commit 2af0509

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Logger.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@ public static function __callStatic($name, $arguments)
4343
$arguments = [$arguments];
4444
}
4545

46-
if (isset($arguments[1])) {
46+
// fix the wrong usage of xlog when second parameter is not an array
47+
if (!isset($arguments[1])) {
4748
$arguments[1] = [];
4849
}
4950

51+
if(!is_array($arguments[1])){
52+
$arguments[1] = [$arguments[1]];
53+
}
54+
5055
if (session_status() == PHP_SESSION_NONE) {
5156
$arguments[1]['sid'] = session_id();
5257
} else {

0 commit comments

Comments
 (0)