From b47fc6476ae30b8ba700d2883dbb4d77f758c682 Mon Sep 17 00:00:00 2001 From: Carlos Date: Sat, 19 May 2012 01:12:29 -0500 Subject: [PATCH] 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 @@ public static function decode($value) 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. *