From bac5df711c48e8052cebe8556b686427ee497ccc Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 28 Jan 2021 14:42:55 +0900 Subject: [PATCH 1/2] fix: add missing escaping --- app/Views/errors/html/error_exception.php | 44 +++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/Views/errors/html/error_exception.php b/app/Views/errors/html/error_exception.php index fc7d32fd2e7b..aabc66f42d0e 100644 --- a/app/Views/errors/html/error_exception.php +++ b/app/Views/errors/html/error_exception.php @@ -19,9 +19,9 @@
-

getCode() ? ' #' . $exception->getCode() : '') ?>

+

getCode() ? ' #' . $exception->getCode() : '') ?>

- getMessage() ?> + getMessage()) ?> getMessage())) ?>" rel="noreferrer" target="_blank">search →

@@ -30,7 +30,7 @@
-

at line

+

at line

@@ -66,11 +66,11 @@ @@ -79,11 +79,11 @@ -   —   +   —   - ( arguments ) -
+ ( arguments ) +
-   —   () +   —   ()

@@ -134,7 +134,7 @@ continue; } ?> -

$

+

$

@@ -199,15 +199,15 @@ - + - + - + @@ -223,7 +223,7 @@ - + @@ -239,7 +239,7 @@ -

$

+

$

Pathuri ?>uri) ?>
HTTP MethodgetMethod(true) ?>getMethod(true)) ?>
IP AddressgetIPAddress() ?>getIPAddress()) ?>
Is AJAX Request?
User AgentgetUserAgent()->getAgentString() ?>getUserAgent()->getAgentString()) ?>
@@ -318,7 +318,7 @@
- +
Response StatusgetStatusCode() . ' - ' . $response->getReason() ?>getStatusCode() . ' - ' . $response->getReason()) ?>
@@ -366,15 +366,15 @@ Memory Usage - + Peak Memory Usage: - + Memory Limit: - + @@ -389,9 +389,9 @@

- Displayed at — - PHP: — - CodeIgniter: + Displayed at — + PHP: — + CodeIgniter:

From 9f547cae62b7953c18753e5c1e8ddb1566b51233 Mon Sep 17 00:00:00 2001 From: kenjis Date: Thu, 28 Jan 2021 14:58:40 +0900 Subject: [PATCH 2/2] fix: replace htmlspecialchars() with esc() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The second argument of htmlspecialchars() is changed. ENT_IGNORE is never used. > Using this flag is discouraged as it ยป may have security implications. https://www.php.net/manual/en/function.htmlspecialchars.php --- app/Views/errors/html/error_exception.php | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/Views/errors/html/error_exception.php b/app/Views/errors/html/error_exception.php index aabc66f42d0e..43a916c4bf95 100644 --- a/app/Views/errors/html/error_exception.php +++ b/app/Views/errors/html/error_exception.php @@ -5,7 +5,7 @@ - <?= htmlspecialchars($title, ENT_SUBSTITUTE, 'UTF-8') ?> + <?= esc($title) ?> @@ -19,7 +19,7 @@