Permalink
Browse files

Merge pull request #113 from ajoneil/2.4-security-fixes

SECURITY: Fix execution of script tags in site name
  • Loading branch information...
2 parents 4abe136 + 0270a4a commit 20161972b89489d8d1c062eecf469996601c5c9b @chillu chillu committed May 3, 2012
Showing with 4 additions and 2 deletions.
  1. +3 −1 code/LeftAndMain.php
  2. +1 −1 javascript/LeftAndMain_left.js
View
@@ -555,8 +555,10 @@ function getSiteTreeFor($className, $rootID = null, $childrenMethod = null, $num
$siteConfig = SiteConfig::current_site_config();
$treeTitle = $siteConfig->Title;
}
+
+ $treeTitle_XML = Convert::raw2xml($treeTitle);
- $siteTree = "<ul id=\"sitetree\" class=\"tree unformatted\"><li id=\"record-0\" class=\"Root nodelete\"><a href=\"$rootLink\"><strong>$treeTitle</strong></a>"
+ $siteTree = "<ul id=\"sitetree\" class=\"tree unformatted\"><li id=\"record-0\" class=\"Root nodelete\"><a href=\"$rootLink\"><strong>$treeTitle_XML</strong></a>"
. $siteTree . "</li></ul>";
}
@@ -140,7 +140,7 @@ TreeAPI.prototype = {
setNodeTitle : function(idx, title) {
this.performOnTreeNode(idx, function(treeNode) {
var aTag = treeNode.getElementsByTagName('a')[0];
- aTag.innerHTML = title;
+ aTag.innerHTML = title.escapeHTML();
});
},

0 comments on commit 2016197

Please sign in to comment.