From 4e257145a878a9327806eb5012fbccf42bfacafe Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 1 Oct 2014 08:40:36 -0400 Subject: [PATCH] Fixing htmlspecialchars issues with the title text Using htmlspecialchars with ENT_COMPAT and double encode false. --- Toolkit/Blocks/Admin/EditPage.php | 1 + Toolkit/Blocks/templates/editPage.html | 2 +- templates/template.html | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Toolkit/Blocks/Admin/EditPage.php b/Toolkit/Blocks/Admin/EditPage.php index b2ca0a7..467b4a5 100644 --- a/Toolkit/Blocks/Admin/EditPage.php +++ b/Toolkit/Blocks/Admin/EditPage.php @@ -97,6 +97,7 @@ class Toolkit_Blocks_Admin_EditPage $stmt->bindParam(':page', $this->_pageId, PDO::PARAM_INT); $stmt->execute(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { + $row['title'] = htmlspecialchars($row['title'], ENT_COMPAT, 'UTF-8', false); if ($row['image']) { $row['imageUrl'] = HOMEPAGE_HEADLINE_THUMB . $row['image']; } diff --git a/Toolkit/Blocks/templates/editPage.html b/Toolkit/Blocks/templates/editPage.html index 1ae3563..fd47feb 100644 --- a/Toolkit/Blocks/templates/editPage.html +++ b/Toolkit/Blocks/templates/editPage.html @@ -116,7 +116,7 @@ type="text" class="title" name="title" - value="{block[title]}"> + value="{block[title]:h}">