2 namespace TYPO3\CMS\Core\Imaging\IconProvider;
48 if (empty($options[
'source'])) {
49 throw new \InvalidArgumentException(
'[' . $icon->
getIdentifier() .
'] The option "source" is required and must not be empty', 1440754980);
52 $source = $options[
'source'];
59 return '<img src="' . htmlspecialchars($source) .
'" width="' . $icon->
getDimension()->getWidth() .
'" height="' . $icon->
getDimension()->getHeight() .
'" />';
70 if (empty($options[
'source'])) {
71 throw new \InvalidArgumentException(
'The option "source" is required and must not be empty', 1440754980);
74 $source = $options[
'source'];
90 if (!file_exists($source)) {
94 $svgContent = file_get_contents($source);
95 $svgContent = preg_replace(
'/<script[\s\S]*?>[\s\S]*?<\/script>/i',
'', $svgContent);
96 $svgElement = simplexml_load_string($svgContent);
99 $domXml = dom_import_simplexml($svgElement);
100 return $domXml->ownerDocument->saveXML($domXml->ownerDocument->documentElement);