Commit 5ade74d2 authored by Kevin von Spiczak's avatar Kevin von Spiczak
Browse files

[BUGFIX] use absolute path for thumbnails

parent 1c9deea3
......@@ -26,6 +26,7 @@
namespace SGalinski\SgYoutube\Service;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\PathUtility;
......@@ -108,6 +109,12 @@ class CachedImageService {
$cachedImageFolderPath = GeneralUtility::getFileAbsFileName(
self::CACHED_IMAGES_DIRECTORY . $this->cacheDirectory . '/'
);
// make absolute path, if the $url is a relative path
if (strpos($url, '/') === 0) {
$url = Environment::getPublicPath() . $url;
}
// Create a hash based on the URL to identify the image
$imageHash = \md5($url);
// check if any kind of image with this hash is already in the cache-directory
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment