zeeos

Patch for TYPO3's EXT:vhs issue #693

Oct 16th, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.31 KB | None | 0 0
  1. diff --git a/www/typo3conf/ext/vhs/Classes/ViewHelpers/Media/Image/AbstractImageViewHelper.php b/www/typo3conf/ext/vhs/Classes/ViewHelpers/Media/Image/AbstractImageViewHelper.php
  2. index 8deb4aa..cae458a 100644
  3. --- a/www/typo3conf/ext/vhs/Classes/ViewHelpers/Media/Image/AbstractImageViewHelper.php
  4. +++ b/www/typo3conf/ext/vhs/Classes/ViewHelpers/Media/Image/AbstractImageViewHelper.php
  5. @@ -117,7 +117,13 @@ abstract class Tx_Vhs_ViewHelpers_Media_Image_AbstractImageViewHelper extends Tx
  6.         }
  7.         $this->imageInfo[3] = \TYPO3\CMS\Core\Utility\GeneralUtility::png_to_gif_by_imagemagick($this->imageInfo[3]);
  8.         $GLOBALS['TSFE']->imagesOnPage[] = $this->imageInfo[3];
  9. -       $this->mediaSource = $GLOBALS['TSFE']->absRefPrefix . \TYPO3\CMS\Core\Utility\GeneralUtility::rawUrlEncodeFP($this->imageInfo[3]);
  10. +       $imagePublicUrl = $this->imageInfo[3];
  11. +       if (strpos($imagePublicUrl, '%') === FALSE) {
  12. +           // $this->imageInfo[3] may contain encoded or unencoded URL depending on whether it comes from the FAL or from the "import"ed image.
  13. +           // Do not double-encode in case of FAL.
  14. +           $imagePublicUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::rawUrlEncodeFP($this->imageInfo[3]);
  15. +       }
  16. +       $this->mediaSource = $GLOBALS['TSFE']->absRefPrefix . $imagePublicUrl;
  17.         if (TYPO3_MODE === 'BE') {
  18.             $this->resetFrontendEnvironment();
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment