Project

General

Profile

Actions

Bug #86428

closed

simplexml_load_string in ImageInfo should ignore warnings

Added by R3 H6 over 5 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
Start date:
2018-09-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

...as it does with errors.

Core: Error handler (FE): PHP Warning: simplexml_load_string(): <sfw xmlns="&ns_sfw;"> in /typo3_src-8.7.19/typo3/sysext/core/Classes/Type/File/ImageInfo.php line 95


Files

Actions #1

Updated by Gerrit Code Review over 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58450

Actions #2

Updated by Tymoteusz Motylewski over 5 years ago

please provide steps to reproduce the issue including example svg file.
Thanks!

Actions #3

Updated by R3 H6 over 5 years ago

Unfortunately I can not provide the full svg because it is from client project which is not yet online.

The problem is, that simplexml_load_string throws a warning if the namespaces are not correct. This should simply be ignored.
It is not the responsibilty of TYPO3 to log/show any error within an uploaded svg image (external resource).

Here just the relevant part:

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
    <!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
    <!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
    <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
    <!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
    <!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
    <!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
    <!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
    <!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
    <!ENTITY st0 "display:none;">
    <!ENTITY st1 "display:inline;fill:#E5E9F5;">
    <!ENTITY st2 "fill:#E5EDF4;">
    <!ENTITY st3 "fill:#005292;">
]>
<svg version="1.0" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" 
     xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 504.57 334.48" 
     style="enable-background:new 0 0 504.57 334.48;" xml:space="preserve">
<!-- ... -->
</svg

From sys_log:

 Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1476107295                               
 : PHP Warning: simplexml_load_string(): namespace warning : xmlns: URI &amp;ns_sfw; is not absolute in
 /var/www/web/typo3/sysext/core/Classes/Type/File/ImageInfo.php line 124 
 | TYPO3\CMS\Core\Error\Exception thrown in file /var/www/web/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 116. 
 Requested URL: http://www.domain.vm/typo3/index.php?route=%%2Fajax%%2Ffile%%2Fprocess&token=--Anonymiz

Updated by Sven Teuber about 5 years ago

Issue still exists in TYPO3 8.7.22. Example SVG attached.
It has something to do with the SVG code Adobe Illustrator exports. After optimizing the file in Inkscape, the SVG code looks very different and the file can be uploaded without errors (second attached file).

Actions #5

Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59802

Actions #6

Updated by Gerrit Code Review almost 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59802

Actions #7

Updated by Gerrit Code Review almost 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59802

Actions #8

Updated by Gerrit Code Review almost 5 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60470

Actions #9

Updated by Remo H. almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Gerrit Code Review almost 5 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60473

Actions #11

Updated by Remo H. almost 5 years ago

  • Status changed from Under Review to Resolved
Actions #12

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions #13

Updated by Spawoz Technologies Pvt Ltd. about 4 years ago

Hi All,

I can able to reproduce the same issue with TYPO3 9.5.13 version. Could you please have a look on this? Because of this, the filelist module is broken. Thank you.

Actions

Also available in: Atom PDF