macopedia / typo3-azurestorage

TYPO3 FAL driver extension for Microsoft Azure Blob Storage
MIT License
4 stars 5 forks source link

Broken backend thumbnails for images with space in the name (or any other character not allowed in url) #1

Closed tmotyl closed 7 years ago

tmotyl commented 7 years ago

How to reproduce:

  1. upload a file with utf-8 character in the name, or a space in the name e.g. "pic ture.png" or "zdjęcie.jpg" to the azure storage
  2. go to the filelist module
  3. thumbnail will be broken

image

  1. the thumbnail url will look like ../https:/storagename.blob.core.windows.net/.... instead of `https://storagename.blob.core.windows.net/....
  2. The problem is caused in the https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/core/Classes/Resource/ResourceStorage.php#L1312 where GeneralUtility::isValidUrl($publicUrl) is checked and fails. Seems that the publicurl should not contain any character not allowed for url. And Azure driver is doing so.
tmotyl commented 7 years ago

changing the code of the getPublicUrl in the similar way it's implemented in https://github.com/TYPO3-extensions/aus_driver_amazon_s3/blob/master/Classes/Driver/AmazonS3Driver.php#L150 solves the issue

benjaminhirsch commented 7 years ago

Thank you, @tmotyl! I've accepted your pull request and created a new release! :)