Skip to content

Commit

Permalink
[BUGFIX] Handle empty absRefPrefix in PageLinkBuilder
Browse files Browse the repository at this point in the history
Using empty values for absRefPrefix as needle in strpos() will
throw a warning. In order to avoid that, it's now checked more
explicitly if the prefixed slash originally was absRefPrefix.

Resolves: #84676
Releases: master
Change-Id: I7515e8d283b2d68e39f7a0451432d453471088f0
Reviewed-on: https://review.typo3.org/56616
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
  • Loading branch information
ohader authored and wouter90 committed Apr 9, 2018
1 parent 3fa35bf commit 52e88b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typo3/sysext/frontend/Classes/Typolink/PageLinkBuilder.php
Expand Up @@ -559,7 +559,7 @@ protected function createTotalUrlAndLinkData($page, $target, $no_cache, $addPara
// $totalUri contains /index.php for legacy URLs, as previously "it was index.php"
// In case an URI has is prefixed with "/" which is not the absRefPrefix, remove it.
// this might change in the future
if (strpos($totalUrl, '/index.php') === 0 && strpos($totalUrl, $absRefPrefix) !== 0) {
if (strpos($totalUrl, '/index.php') === 0 && $absRefPrefix !== '/') {
$totalUrl = substr($totalUrl, 1);
}

Expand Down

0 comments on commit 52e88b7

Please sign in to comment.