1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-15 09:05:57 +00:00

* sql_bool_to_bool: make parameter nullable

* errorhandler: don't try to truncate null strings
 * UrlHelper::rewrite_relative: fix undefined offset warnings for URLs
that lack schema/host (data: etc)
This commit is contained in:
Andrew Dolgov
2021-11-20 16:11:44 +03:00
parent e7111e4f14
commit 3323ae78ce
3 changed files with 9 additions and 4 deletions

View File

@@ -341,7 +341,12 @@
}
}
function sql_bool_to_bool(string $s): bool {
/** Convert values accepted by tt-rss as true/false to PHP booleans
* @see https://tt-rss.org/wiki/ApiReference#boolean-values
* @param null|string $s null values are considered false
* @return bool
*/
function sql_bool_to_bool(?string $s): bool {
return $s && ($s !== "f" && $s !== "false"); //no-op for PDO, backwards compat for legacy layer
}