Project

General

Profile

Actions

Bug #85336

closed

f:uri.image behaves inconsistent with utf8 names whether using src or image

Added by S P over 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Start date:
2018-06-22
Due date:
% Done:

0%

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

Description

I have a file with special utf8 characters in the path: /fileadmin/special-páth/file.pdf (notice the "á" in the path name).

First I did this: {f:uri.image(src: file.originalResource.publicUrl)} - this returned an empty string.

Then I did this: {f:uri.image(image: file)} - this returned the correct path.

SYS\UTF8filesytem => true is set and the filesystem actually is UTF-8 capable, the locales also are set to UTF8 and all other utf8-scenarios are working. Both methods (src and image) are working fine on ASCII-only paths.

I assume this mis-behaviour is also true for other view helpers such as f:image.

Actions #1

Updated by S P over 6 years ago

The last sentence should end with "other view helpers such as f:image.", sorry.

Actions #2

Updated by Frans Saris over 6 years ago

  • Description updated (diff)
Actions #3

Updated by S P over 6 years ago

Oh, I forgot to mention (just in case that was not clear), the problem is NOT that publicUrl returns empty! publicUrl returns the correct path with special characters. So doing <a href="{file.originalResource.publicUrl}">Foo</a> renders a working link to the file. Only the combination with the uri (and probably also image) VH does not work.

Actions #4

Updated by Frans Saris over 6 years ago

You shouldn't use {f:uri.image(src: file.originalResource.publicUrl)} always use the object when possible! Did is faster and when you use fileReferences the cropping wil get lost this way.

Actions #5

Updated by S P over 6 years ago

You are right. But this does not change anything that there's some bug wrt to handling utf-8 paths somewhere. This is what I have reported.

Actions #6

Updated by Susanne Moog about 6 years ago

  • Target version changed from 8.7.19 to Candidate for patchlevel
Actions #7

Updated by Susanne Moog over 4 years ago

  • Status changed from New to Closed

This is not a misbehaviour or even a bug. publicUrl returns the public url - which is actually urlencoded. This is not the plain file name or path but the urlencoded one.

For example:

public URL: fileadmin/%C3%A4f%C3%B6ld%C3%A4r/special-p%C3%A1th.png
path: fileadmin/äföldär/special-páth.png

with the encoded path the image view helper is unable to find the file and therefor cannot render anything, as it expects the plain file path.

If you try and hardcode the path: {f:uri.image(src: "fileadmin/äföldär/special-páth.png")} - you'll note that this in fact does work.

Actions

Also available in: Atom PDF