aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_rss.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-04-17 19:53:54 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-17 19:53:54 +0200
commit687d0b40a89bfaa5fcf99e76b3094c7c4e744f73 (patch)
treea3fcdf0f2234a4719fdeb983730befc9f7d85bed /lib/lib_rss.php
parent8cc8127c3c8ed1b99135b21424134eabec30f150 (diff)
Fix safe_ascii (#5311)
Fix https://github.com/FreshRSS/FreshRSS/issues/5310
Diffstat (limited to 'lib/lib_rss.php')
-rw-r--r--lib/lib_rss.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 22af2729b..d4dd1635d 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -132,8 +132,8 @@ function checkUrl(string $url, bool $fixScheme = true) {
}
}
-function safe_ascii(string $text): string {
- return filter_var($text, FILTER_DEFAULT, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH) ?: '';
+function safe_ascii(?string $text): string {
+ return $text === null ? '' : (filter_var($text, FILTER_DEFAULT, FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH) ?: '');
}
if (function_exists('mb_convert_encoding')) {