Commit b18ca5d1 authored by Wouter Wolters's avatar Wouter Wolters Committed by Markus Klein
Browse files

[BUGFIX] Wrong path generated for icon in NewContentElementController

When using EXT:myext/icon.png in the new content element wizard,
a wrong path is generated. The current solution only works for core
extension. Fix this by creating a correct relative path.
Allow usage of absolute paths too.

Resolves: #68575
Releases: master
Change-Id: Ideccb89da85fc81722e880f386514e56feb88069
Reviewed-on: http://review.typo3.org/42044


Reviewed-by: default avatarGeorg Tiefenbrunn <georg.tiefenbrunn@gmail.com>
Tested-by: default avatarGeorg Tiefenbrunn <georg.tiefenbrunn@gmail.com>
Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
parent a8c421bf
......@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Backend\Controller\ContentElement;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\Utility\IconUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\PathUtility;
/**
* Script Class for the New Content element wizard
......@@ -238,9 +239,11 @@ class NewContentElementController {
}
$icon = $wInfo['icon'];
if (strpos($wInfo['icon'], '..') === FALSE) {
if (strpos($wInfo['icon'], '..') === FALSE && !GeneralUtility::isAbsPath($icon)) {
$icon = GeneralUtility::getFileAbsFileName($icon, TRUE, TRUE);
$icon = substr($icon, strlen(PATH_typo3));
$pathInfo = PathUtility::pathinfo($icon);
$path = PathUtility::getRelativePathTo($pathInfo['dirname']);
$icon = $path . $pathInfo['basename'];
}
$menuItems[$key]['content'] .= '
<div class="media">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment