Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
TYPO3
sg_youtube
Commits
5ade74d2
Commit
5ade74d2
authored
Mar 31, 2022
by
Kevin von Spiczak
Browse files
[BUGFIX] use absolute path for thumbnails
parent
1c9deea3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Classes/Service/CachedImageService.php
View file @
5ade74d2
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment