diff --git a/lib/documentmanagement/observers.inc.php b/lib/documentmanagement/observers.inc.php
index 8bd8e4e..ef76b1d 100644
--- a/lib/documentmanagement/observers.inc.php
+++ b/lib/documentmanagement/observers.inc.php
@@ -6,7 +6,7 @@
* License Version 1.1.2 ("License"); You may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.knowledgetree.com/KPL
- *
+ *
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* See the License for the specific language governing rights and
@@ -17,9 +17,9 @@
* (ii) the KnowledgeTree copyright notice
* in the same form as they appear in the distribution. See the License for
* requirements.
- *
+ *
* The Original Code is: KnowledgeTree Open Source
- *
+ *
* The Initial Developer of the Original Code is The Jam Warehouse Software
* (Pty) Ltd, trading as KnowledgeTree.
* Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
@@ -77,7 +77,7 @@ class JavascriptObserver {
printf('', $msg->getString());
return;
}
- printf('', $msg->getString());
+ printf('', htmlentities($msg->getString(),ENT_QUOTES,'UTF-8'));
}
function redirectToDocument($id) {
diff --git a/plugins/rssplugin/KTrss.inc.php b/plugins/rssplugin/KTrss.inc.php
index 1cfb75f..91a352f 100644
--- a/plugins/rssplugin/KTrss.inc.php
+++ b/plugins/rssplugin/KTrss.inc.php
@@ -186,7 +186,7 @@ class KTrss{
if ($aDocumentList) {
foreach($aDocumentList as $documentElement){
$document_id = $documentElement['id'];
- $aDocumentTransactions = array_merge($aDocumentTransactions, KTrss::getDocumentTransactions($document_id));
+ $aDocumentTransactions = kt_array_merge($aDocumentTransactions, KTrss::getDocumentTransactions($document_id));
}
}
if ($aDocumentTransactions){
@@ -220,8 +220,8 @@ class KTrss{
// get information for folder
function getOneFolder($iFolderId){
$aFData = KTrss::getFolderData($iFolderId);
- $aFTransactions = array_merge(KTrss::getChildrenFolderTransactions($iFolderId), KTrss::getFolderTransactions($iFolderId));
- $aFTransactions = array_merge($aFTransactions, KTrss::getChildrenDocumentTransactions($iFolderId));
+ $aFTransactions = kt_array_merge(KTrss::getChildrenFolderTransactions($iFolderId), KTrss::getFolderTransactions($iFolderId));
+ $aFTransactions = kt_array_merge($aFTransactions, KTrss::getChildrenDocumentTransactions($iFolderId));
$code = 'if (strtotime($a[datetime]) == strtotime($b[datetime])){
return 0;
@@ -255,6 +255,17 @@ class KTrss{
}
}
+ function rss_sanitize($str, $do_amp=true)
+ {
+
+ $result = str_replace("\\\"","\"",str_replace('\\\'','\'',htmlentities($str,ENT_NOQUOTES, 'UTF-8')));
+ if ($do_amp)
+ {
+ $result = str_replace('&','&',$result);
+ }
+ return $result;
+ }
+
// Takes in an array as a parameter and returns rss2.0 compatible xml
function arrayToXML($aItems){
// Build path to host
@@ -282,7 +293,7 @@ class KTrss{
$sTypeSelect = 'document.transactionhistory&fDocumentId';
}
$feed .= "{$custom_title}
+{$custom_title|sanitize}
{/if}
diff --git a/templates/kt3/minimal_page.smarty b/templates/kt3/minimal_page.smarty
index 70c944f..dc03a91 100644
--- a/templates/kt3/minimal_page.smarty
+++ b/templates/kt3/minimal_page.smarty
@@ -76,9 +76,9 @@
{i18n}You are here{/i18n}:
{if ($page->breadcrumbSection !== false)}
{if ($page->breadcrumbSection.url) }
- {$page->breadcrumbSection.label}
+ {$page->breadcrumbSection.label|sanitize}
{else}
- {$page->breadcrumbSection.label}
+ {$page->breadcrumbSection.label|sanitize}
{/if}
{/if}
{if (($page->breadcrumbSection !== false) && ($page->breadcrumbs !== false))}
@@ -97,7 +97,7 @@
{/foreach}
{/if}
{if ($page->breadcrumbDetails !== false)}
-({$page->breadcrumbDetails})
+({$page->breadcrumbDetails|sanitize})
{/if}
diff --git a/templates/kt3/standard_page.smarty b/templates/kt3/standard_page.smarty
index 2618c4b..8679663 100644
--- a/templates/kt3/standard_page.smarty
+++ b/templates/kt3/standard_page.smarty
@@ -142,7 +142,7 @@
{/foreach}
{/if}
{if ($page->breadcrumbDetails !== false)}
- ({$page->breadcrumbDetails})
+ ({$page->breadcrumbDetails|sanitize})
{/if}
{/if}
diff --git a/templates/ktcore/folder/view_permissions.smarty b/templates/ktcore/folder/view_permissions.smarty
index 33856cc..fc5ba2d 100644
--- a/templates/ktcore/folder/view_permissions.smarty
+++ b/templates/ktcore/folder/view_permissions.smarty
@@ -16,7 +16,7 @@ assigned are shown.{/i18n}