Merge branch '3.6' into 3

This commit is contained in:
Daniel Hensby 2017-08-24 13:14:47 +01:00
commit 636bf45b5f
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E
3 changed files with 5 additions and 9 deletions

View File

@ -20,7 +20,7 @@ class CMSPageAddController extends CMSPageEditController {
$pageTypes = array(); $pageTypes = array();
foreach($this->PageTypes() as $type) { foreach($this->PageTypes() as $type) {
$html = sprintf('<span class="page-icon class-%s"></span><strong class="title">%s</strong><span class="description">%s</span>', $html = sprintf('<span class="page-icon class-%s"></span><strong class="title">%s</strong><span class="description">%s</span>',
$type->getField('ClassName'), Convert::raw2htmlid($type->getField('ClassName')),
$type->getField('AddAction'), $type->getField('AddAction'),
$type->getField('Description') $type->getField('Description')
); );

View File

@ -33,12 +33,7 @@ class LeftAndMainPageIconsExtension extends Extension {
// Legacy support: Add file extension if none exists // Legacy support: Add file extension if none exists
if(!pathinfo($iconFile, PATHINFO_EXTENSION)) $iconFile .= '-file.gif'; if(!pathinfo($iconFile, PATHINFO_EXTENSION)) $iconFile .= '-file.gif';
$iconPathInfo = pathinfo($iconFile); $class = Convert::raw2htmlid($class);
// Base filename
$baseFilename = $iconPathInfo['dirname'] . '/' . $iconPathInfo['filename'];
$fileExtension = $iconPathInfo['extension'];
$selector = ".page-icon.class-$class, li.class-$class > a .jstree-pageicon"; $selector = ".page-icon.class-$class, li.class-$class > a .jstree-pageicon";
if(Director::fileExists($iconFile)) { if(Director::fileExists($iconFile)) {

View File

@ -2837,7 +2837,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
} }
$flags = $this->getStatusFlags(); $flags = $this->getStatusFlags();
$treeTitle = sprintf( $treeTitle = sprintf(
"<span class=\"jstree-pageicon\"></span><span class=\"item\" data-allowedchildren=\"%s\">%s</span>", "<span class=\"jstree-pageicon page-icon class-%s\"></span><span class=\"item\" data-allowedchildren=\"%s\">%s</span>",
Convert::raw2htmlid($this->class),
Convert::raw2att(Convert::raw2json($children)), Convert::raw2att(Convert::raw2json($children)),
Convert::raw2xml(str_replace(array("\n","\r"),"",$this->MenuTitle)) Convert::raw2xml(str_replace(array("\n","\r"),"",$this->MenuTitle))
); );
@ -2890,7 +2891,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
* @return string * @return string
*/ */
public function CMSTreeClasses($numChildrenMethod="numChildren") { public function CMSTreeClasses($numChildrenMethod="numChildren") {
$classes = sprintf('class-%s', $this->class); $classes = sprintf('class-%s', Convert::raw2htmlid($this->class));
if($this->HasBrokenFile || $this->HasBrokenLink) { if($this->HasBrokenFile || $this->HasBrokenLink) {
$classes .= " BrokenLink"; $classes .= " BrokenLink";
} }