brainworxx/lazyFxx-TYPO3-Extension

Problem with special characters in filenames

Closed this issue · 7 comments

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

Hi WiesBen.

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

  • Is the image displayed when using the original image view helper (<f:image src=" . . . )?
  • What operating system does your server use?

Tobi

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

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 <f:image /> 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

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

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?

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

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.