aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/Utils.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/Utils.php')
-rw-r--r--application/Utils.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/application/Utils.php b/application/Utils.php
index 4b7fc546..9c9eaaa2 100644
--- a/application/Utils.php
+++ b/application/Utils.php
@@ -87,10 +87,14 @@ function endsWith($haystack, $needle, $case = true)
87 * 87 *
88 * @param mixed $input Data to escape: a single string or an array of strings. 88 * @param mixed $input Data to escape: a single string or an array of strings.
89 * 89 *
90 * @return string escaped. 90 * @return string|array escaped.
91 */ 91 */
92function escape($input) 92function escape($input)
93{ 93{
94 if (null === $input) {
95 return null;
96 }
97
94 if (is_bool($input)) { 98 if (is_bool($input)) {
95 return $input; 99 return $input;
96 } 100 }
@@ -294,15 +298,15 @@ function normalize_spaces($string)
294 * Requires php-intl to display international datetimes, 298 * Requires php-intl to display international datetimes,
295 * otherwise default format '%c' will be returned. 299 * otherwise default format '%c' will be returned.
296 * 300 *
297 * @param DateTime $date to format. 301 * @param DateTimeInterface $date to format.
298 * @param bool $time Displays time if true. 302 * @param bool $time Displays time if true.
299 * @param bool $intl Use international format if true. 303 * @param bool $intl Use international format if true.
300 * 304 *
301 * @return bool|string Formatted date, or false if the input is invalid. 305 * @return bool|string Formatted date, or false if the input is invalid.
302 */ 306 */
303function format_date($date, $time = true, $intl = true) 307function format_date($date, $time = true, $intl = true)
304{ 308{
305 if (! $date instanceof DateTime) { 309 if (! $date instanceof DateTimeInterface) {
306 return false; 310 return false;
307 } 311 }
308 312