From 5bef4c6e8503007130ad6eb4476c0e7c814debcd Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Wed, 27 May 2009 23:26:45 -0400 Subject: [PATCH] php 5.2.3 and above has a built-in way to do escapeOnce --- framework/View/lib/Horde/View/Helper/Tag.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/framework/View/lib/Horde/View/Helper/Tag.php b/framework/View/lib/Horde/View/Helper/Tag.php index 837bdc4e8..663e9eba3 100644 --- a/framework/View/lib/Horde/View/Helper/Tag.php +++ b/framework/View/lib/Horde/View/Helper/Tag.php @@ -112,7 +112,11 @@ class Horde_View_Helper_Tag extends Horde_View_Helper_Base */ public function escapeOnce($html) { - return $this->_fixDoubleEscape($this->_view->escape($html)); + if (version_compare(PHP_VERSION, '5.2.3', '>=')) { + return htmlspecialchars($html, ENT_QUOTES, $this->_view->getEncoding(), false); + } else { + return $this->_fixDoubleEscape($this->_view->escape($html)); + } } /** -- 2.11.0