From b47fc6476ae30b8ba700d2883dbb4d77f758c682 Mon Sep 17 00:00:00 2001 From: Carlos Date: Sat, 19 May 2012 01:12:29 -0500 Subject: [PATCH 1/3] Added a function for handling HTML special characters --- laravel/html.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/laravel/html.php b/laravel/html.php index d1f199aa..1e484a1d 100644 --- a/laravel/html.php +++ b/laravel/html.php @@ -45,6 +45,19 @@ class HTML { return html_entity_decode($value, ENT_QUOTES, Config::get('application.encoding')); } + /** + * Convert HTML special characters. + * + * The encoding specified in the application configuration file will be used. + * + * @param string $value + * @return string + */ + public static function specialchars($value) + { + return htmlspecialchars($value, ENT_QUOTES, Config::get('application.encoding', false)); + } + /** * Generate a link to a JavaScript file. * From 23a25b9abb3442938595d1d3b249d73d039bf5bd Mon Sep 17 00:00:00 2001 From: Carlos Date: Sat, 19 May 2012 01:17:53 -0500 Subject: [PATCH 2/3] Revert "Added a function for handling HTML special characters" This reverts commit b47fc6476ae30b8ba700d2883dbb4d77f758c682. --- laravel/html.php | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/laravel/html.php b/laravel/html.php index 1e484a1d..d1f199aa 100644 --- a/laravel/html.php +++ b/laravel/html.php @@ -45,19 +45,6 @@ class HTML { return html_entity_decode($value, ENT_QUOTES, Config::get('application.encoding')); } - /** - * Convert HTML special characters. - * - * The encoding specified in the application configuration file will be used. - * - * @param string $value - * @return string - */ - public static function specialchars($value) - { - return htmlspecialchars($value, ENT_QUOTES, Config::get('application.encoding', false)); - } - /** * Generate a link to a JavaScript file. * From e057193de0d3eb9370605cd8d67d6df1beeb1c7a Mon Sep 17 00:00:00 2001 From: Carlos Date: Sat, 19 May 2012 01:21:18 -0500 Subject: [PATCH 3/3] Added function for converting html special characters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With entities there are problems encoding characters in other languages, for example á, ó, in spanish will become special characters. --- laravel/html.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/laravel/html.php b/laravel/html.php index d1f199aa..109d459a 100644 --- a/laravel/html.php +++ b/laravel/html.php @@ -45,6 +45,19 @@ class HTML { return html_entity_decode($value, ENT_QUOTES, Config::get('application.encoding')); } + /** + * Convert HTML special characters. + * + * The encoding specified in the application configuration file will be used. + * + * @param string $value + * @return string + */ + public static function specialchars($value) + { + return htmlspecialchars($value, ENT_QUOTES, Config::get('application.encoding'), false); + } + /** * Generate a link to a JavaScript file. *