Skip to content

Commit

Permalink
[BUGFIX] fix misuse of 11LTS BE processing middleware URLs
Browse files Browse the repository at this point in the history
this fixes #187

The situation is as follows: starting with 11LTS in the backend processed images get not a `/fileaadmin/_processed/` "resulting image" style url but a new `/typo3/image/process?token` "middleware" style url. However that is only available for logged in BE users. Thus this can be saved to RTE and displayed there, however will break the frontend output.

Now I tried to fix what is saved in the backend/db, but came to the conclusion that this shouldn't be the aim, as there are probably reasons for the backend using that new URL.

Thus my approach here is to accept this new URL, accept the "bug" that this new URL gets converted to an absolute URL and rather tackle the problem while generating frontend output, where the generation is skipped formerly, because it sees "external URL". Now an if just checks for the string `'/typo3/image/process?token'` and starts reprocessing.
  • Loading branch information
jpmschuler committed Oct 29, 2022
1 parent 8f9fc92 commit 28687cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Classes/Controller/ImageRenderingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ protected function getMagicImageService()
protected function isExternalImage()
{
$srcAbsoluteUrl = $this->cObj->parameters['src'];
if (strpos($srcAbsoluteUrl, '/typo3/image/process?token') !== false) {
// is a 11LTS backend processing url only valid for BE users, thus reprocessing needed
return false;
}
return strtolower(substr($srcAbsoluteUrl, 0, 4)) === 'http' || substr($srcAbsoluteUrl, 0, 2) === '//';
}

Expand Down

0 comments on commit 28687cd

Please sign in to comment.