From fbf05a159bc1a688940c16dc304eaaf140188b01 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 28 Jul 2006 07:56:03 +0000 Subject: Time-Tracker Demo: Escape html entities in output. --- demos/time-tracker/index.php | 7 +++++++ .../protected/pages/TimeTracker/CategoryDataList.tpl | 6 +++--- .../time-tracker/protected/pages/TimeTracker/Login.page | 1 + .../protected/pages/TimeTracker/MainLayout.tpl | 2 +- .../protected/pages/TimeTracker/ReportProject.page | 16 ++++++++-------- .../protected/pages/TimeTracker/ReportProject.php | 8 +++++++- .../protected/pages/TimeTracker/ReportResource.page | 16 ++++++++-------- .../protected/pages/TimeTracker/ReportResource.php | 11 ++++++++++- .../time-tracker/protected/pages/TimeTracker/SiteMap.tpl | 6 +++--- .../protected/pages/TimeTracker/TimeEntryList.tpl | 6 +++--- .../protected/pages/TimeTracker/UserList.page | 4 ++-- 11 files changed, 53 insertions(+), 30 deletions(-) diff --git a/demos/time-tracker/index.php b/demos/time-tracker/index.php index 0f8f412a..69e6b5c5 100644 --- a/demos/time-tracker/index.php +++ b/demos/time-tracker/index.php @@ -14,6 +14,13 @@ if(!is_writable($runtimePath)) require_once($frameworkPath); +function h($text) +{ + $app = Prado::getApplication()->getGlobalization(); + $charset = $app ? $app->getCharset() : 'UTF-8'; + return htmlentities($text, ENT_QUOTES, $charset); +} + $application=new TApplication; $application->run(); diff --git a/demos/time-tracker/protected/pages/TimeTracker/CategoryDataList.tpl b/demos/time-tracker/protected/pages/TimeTracker/CategoryDataList.tpl index 7a19dadb..0b62300c 100644 --- a/demos/time-tracker/protected/pages/TimeTracker/CategoryDataList.tpl +++ b/demos/time-tracker/protected/pages/TimeTracker/CategoryDataList.tpl @@ -16,9 +16,9 @@ - <%# $this->DataItem->Name %> - <%# $this->DataItem->Abbreviation %> - <%# $this->DataItem->EstimateDuration %> + <%# h($this->DataItem->Name) %> + <%# h($this->DataItem->Abbreviation) %> + <%# h($this->DataItem->EstimateDuration) %> \ No newline at end of file diff --git a/demos/time-tracker/protected/pages/TimeTracker/MainLayout.tpl b/demos/time-tracker/protected/pages/TimeTracker/MainLayout.tpl index 2d8bad44..915b2fb3 100644 --- a/demos/time-tracker/protected/pages/TimeTracker/MainLayout.tpl +++ b/demos/time-tracker/protected/pages/TimeTracker/MainLayout.tpl @@ -13,7 +13,7 @@