Skip to content

Commit

Permalink
[BUGFIX] Assimilate deprecated and removed method
Browse files Browse the repository at this point in the history
  • Loading branch information
NamelessCoder committed Jan 26, 2025
1 parent 16cbfe4 commit a834617
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Classes/Service/PageService.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,18 @@ public function hidePageForLanguageUid($page = null, int $languageUid = -1, bool
public function getItemLink(array $page, bool $forceAbsoluteUrl = false): string
{
if ((integer) $page['doktype'] === PageRepository::DOKTYPE_LINK) {
$parameter = $this->getPageRepository()->getExtURL($page);
$redirectTo = $page['url'] ?? '';
$uI = parse_url($redirectTo);
// If relative path, prefix Site URL
// If it's a valid email without protocol, add "mailto:"
if (!($uI['scheme'] ?? false)) {
if (GeneralUtility::validEmail($redirectTo)) {
$redirectTo = 'mailto:' . $redirectTo;
} elseif ($redirectTo[0] !== '/') {
$redirectTo = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $redirectTo;
}
}
$parameter = $redirectTo;
} else {
$parameter = $page['uid'];
}
Expand Down

0 comments on commit a834617

Please sign in to comment.