From 61f8477fab55a258f39a3d598f67f7cc0ffd6aca Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 5 Jan 2018 09:50:08 -0600 Subject: [PATCH] add option for double encode --- src/Illuminate/Support/helpers.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php index 81145ab8f41e..d57c49817f0c 100755 --- a/src/Illuminate/Support/helpers.php +++ b/src/Illuminate/Support/helpers.php @@ -568,15 +568,16 @@ function dd(...$args) * Escape HTML special characters in a string. * * @param \Illuminate\Contracts\Support\Htmlable|string $value + * @param bool $doubleEncode * @return string */ - function e($value) + function e($value, $doubleEncode = false) { if ($value instanceof Htmlable) { return $value->toHtml(); } - return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', false); + return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode); } }