Skip to content

Commit 9044f6e

Browse files
committed
Update entity.php to safely handle null and boolean values in key details like in fce4d8b
1 parent 70c9ec8 commit 9044f6e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

model/entity.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ public function log($details, $level = LOG_INFO, User $actor = null) {
8989

9090
$text = "KeysScope=\"{$scope}\" KeysRequester=\"{$actor->uid}\"";
9191
foreach($details as $key => $value) {
92-
$text .= ' Keys'.ucfirst($key).'="'.str_replace('"', '', $value).'"';
92+
$safe_value = ($value === null) ? '' : (is_bool($value) ? ($value ? 'true' : 'false') : (string)$value);
93+
$text .= ' Keys'.ucfirst($key).'="'.str_replace('"', '', $safe_value).'"';
9394
}
9495
openlog('keys', LOG_ODELAY, LOG_AUTH);
9596
syslog($level, $text);

0 commit comments

Comments
 (0)