diff options
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 9c9d44a4c..1ae99e6a1 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -224,7 +224,7 @@ function html_only_entity_decode(?string $text): string { function sensitive_log($log) { if (is_array($log)) { foreach ($log as $k => $v) { - if (in_array($k, ['api_key', 'Passwd', 'T'])) { + if (in_array($k, ['api_key', 'Passwd', 'T'], true)) { $log[$k] = '██'; } elseif (is_array($v) || is_string($v)) { $log[$k] = sensitive_log($v); @@ -331,7 +331,7 @@ function customSimplePie(array $attributes = array()): SimplePie { /** @param string $data */ function sanitizeHTML(string $data, string $base = '', ?int $maxLength = null): string { - if (!is_string($data) || ($maxLength !== null && $maxLength <= 0)) { + if ($data === '' || ($maxLength !== null && $maxLength <= 0)) { return ''; } if ($maxLength !== null) { @@ -851,8 +851,9 @@ function errorMessageInfo(string $errorTitle, string $error = ''): string { $message = ''; $details = ''; - // Prevent empty tags by checking if error isn not empty first - if ($error) { + $error = trim($error); + // Prevent empty tags by checking if error is not empty first + if ($error !== '') { $error = htmlspecialchars($error, ENT_NOQUOTES, 'UTF-8') . "\n"; // First line is the main message, other lines are the details |
