From a0bd689287c2eeb112f6d5af601874b1566618e2 Mon Sep 17 00:00:00 2001 From: Teranode Date: Mon, 11 Apr 2022 22:31:27 -0700 Subject: [PATCH 1/3] Can't pass null to non-nullable arguments extension of: https://github.com/wintercms/winter/pull/524 There should be a better way of handling this. --- src/Filesystem/Filesystem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Filesystem/Filesystem.php b/src/Filesystem/Filesystem.php index 640d73ca..6e956fba 100644 --- a/src/Filesystem/Filesystem.php +++ b/src/Filesystem/Filesystem.php @@ -213,7 +213,7 @@ public function symbolizePath($path, $default = false) return $default === false ? $path : $default; } - $_path = substr($path, 1); + $_path = substr($path ?? '', 1); return $this->pathSymbols[$firstChar] . $_path; } @@ -224,7 +224,7 @@ public function symbolizePath($path, $default = false) */ public function isPathSymbol($path) { - $firstChar = substr($path, 0, 1); + $firstChar = substr($path ?? '', 0, 1); if (isset($this->pathSymbols[$firstChar])) { return $firstChar; } From 59ad7e12509ad05b8edfabea429012482b082fef Mon Sep 17 00:00:00 2001 From: Teranode Date: Tue, 12 Apr 2022 01:16:59 -0700 Subject: [PATCH 2/3] Update helpers.php --- src/Support/helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Support/helpers.php b/src/Support/helpers.php index e9b5d139..ca0419ca 100644 --- a/src/Support/helpers.php +++ b/src/Support/helpers.php @@ -20,7 +20,7 @@ function e($value, $doubleEncode = false) return $value->toHtml(); } - return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode); + return htmlspecialchars($value ?? '', ENT_QUOTES, 'UTF-8', $doubleEncode); } } From 2cd478049899b13a8b8254b9d750346e760819df Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Fri, 8 Jul 2022 23:53:21 -0600 Subject: [PATCH 3/3] Update src/Support/helpers.php --- src/Support/helpers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Support/helpers.php b/src/Support/helpers.php index 59728420..6863d796 100644 --- a/src/Support/helpers.php +++ b/src/Support/helpers.php @@ -20,7 +20,7 @@ function e($value, $doubleEncode = false) return $value->toHtml(); } - return htmlspecialchars($value ?? '', ENT_QUOTES, 'UTF-8', $doubleEncode); + return htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8', $doubleEncode); } }