brainworxx / lazyFxx-TYPO3-Extension

Using the image processing framework of TYPO3 to create placeholder images.
GNU Lesser General Public License v2.1
4 stars 0 forks source link

Problem with special characters in filenames #2

Closed WiesBen closed 4 years ago

WiesBen commented 5 years ago

Causes Extension to brick whole website.

I used filename pokalschießen.jpg and got Error Message:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1509741911: Folder "/templates/images/pokalschie%%C3%%9Fen.jpg/" does not exist. | TYPO3Fluid\Fluid\Core\ViewHelper\Exception thrown in file /homepages/9/d760139845/htdocs/typo3conf/ext/lazyfxx/Classes/Xclass/ImageViewHelper.php in line 105. Requested URL: https://xxx.de/de/start

guelzow commented 5 years ago

Hi WiesBen.

Sadly, I can not reproduce this, but I have some questions:

Tobi

WiesBen commented 5 years ago

Yes if I use f:image and the image object as src parameter (not from your extension) it is working correctly as the special characters get html_encoded. OS is Linux 4.4.0-ui19043.013-uiabi1-infong-amd64

guelzow commented 5 years ago

I was able to reproduce some of this:

The additional % are added by the backend logger, for some reason. The src string in the ViewHelper looks like this: template/images/Pokalschie%C3%9Fen.png Which is url encoded.

Inside the template file there is something like:

<lfxx:image src="template/images/Pokalschie%C3%9Fen.png" alt="alt text" />

Which is also url encode.

The thing is, it should not be url encoded, because the file abstraction layer uses the src string to identify the actual file. It then creates a file object, which then will get processed (or not, depending on other stuff). This file object will then provide the url for the frontend (which is correctly url encoded).

The problem here is, that the filename is not Pokalschie%C3%9Fen.png. The file abstraction layer can not find it, claiming that the folder does not exist.

Disclaimer: The same problem will show up with the ViewHelper.

And some questions: Can you check, if the src path in the template is url encoded? What TYPO3 version are you using (9.5.x according to the error number, but what version exactly)?

Tobi

guelzow commented 4 years ago

I hate to tell people this, but: Closed, won't fix.

We try to do this extension as close to the core as possible. The file lookup for the ViewHelpers are the same as in the original ViewHelpers, because we extend them.

The file name is actually pokalschießen.jpg, and not the url encoded pokalschie%C3%9Fen.png. The original ViewHelpers use the real file name and not the url encoded ones, as does the extension.

Tobi

haug-den-lucas commented 4 years ago

Hi,

I'm sorry I'm commenting here again, but I'm currently tying to upgrade to Typo3 9.5.15 I don't have this extension installed but it is the only information I can find which is related to my problem. After upgrading inside my test environment all pictures in an entry on the website which contain a special character, like ä, ß or similar throw the error shown above. @WiesBen did you find a solution for this?

guelzow commented 4 years ago

Hi Lucas.

That does sound like a problem with the DB coalition. The FAL stores it's data in the sys_file table. When uploading and then using an image with the name Pokalschießen.png, it then creates an entry with an identifier, something like this: /introduction/Pokalschießen.png (depending on where the image is located).

Can you take a look at the FAL records for these images?

Tobi

haug-den-lucas commented 4 years ago

Thank your for your answer. Interestingly yesterday the error simply disappeared, after I gave up fixing the error. I can imagine the error disappeared, because i started reindexing the files because of some other changes. Maybe that fixed this error too.