summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/errorhandler.php2
-rw-r--r--include/functions.php7
2 files changed, 7 insertions, 2 deletions
diff --git a/include/errorhandler.php b/include/errorhandler.php
index 09d6bd7bc..ff2af8cd0 100644
--- a/include/errorhandler.php
+++ b/include/errorhandler.php
@@ -19,7 +19,7 @@ function format_backtrace($trace): string {
array_push($fmt_args, "[" . truncate_string(json_encode($a), 256, "...")) . "]";
} else if (is_resource($a)) {
array_push($fmt_args, truncate_string(get_resource_type($a), 256, "..."));
- } else {
+ } else if ($a) {
array_push($fmt_args, truncate_string($a, 256, "..."));
}
}
diff --git a/include/functions.php b/include/functions.php
index af4819f00..14de32e95 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -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
}