Commit 40ebc6bb authored by Benni Mack's avatar Benni Mack Committed by Georg Ringer
Browse files

[!!!][TASK] Remove prefixLocalAnchors in HtmlParser

The option prefixLocalAnchors in HtmlParser was not used
anymore since the removal of its main functionality
in #65934 with TYPO3 v8.0, and is now removed, as it
is a leftover of past functionality before site handling
and proper URL generation.

Resolves: #96501
Releases: main
Change-Id: Ia037f02729cf731ea60e4a49174bdb0caff34c0b

Tested-by: core-ci's avatarcore-ci <>
Tested-by: Christian Kuhn's avatarChristian Kuhn <>
Tested-by: Wouter Wolters's avatarWouter Wolters <>
Tested-by: Georg Ringer's avatarGeorg Ringer <>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <>
parent 6053476c
......@@ -17,7 +17,6 @@ namespace TYPO3\CMS\Core\Html;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
* Functions for parsing HTML.
......@@ -555,18 +554,6 @@ class HtmlParser
if ((string)($params['removeIfEquals'] ?? '') !== '' && $this->caseShift($tagAttrib[0][$attr], $params['casesensitiveComp']) === $this->caseShift($params['removeIfEquals'], $params['casesensitiveComp'])) {
if ($params['prefixLocalAnchors'] ?? false) {
if ($tagAttrib[0][$attr][0] === '#') {
if ($params['prefixLocalAnchors'] == 2) {
/** @var ContentObjectRenderer $contentObjectRenderer */
$contentObjectRenderer = GeneralUtility::makeInstance(ContentObjectRenderer::class);
$prefix = $contentObjectRenderer->getUrlToCurrentLocation();
} else {
$prefix = GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
$tagAttrib[0][$attr] = $prefix . $tagAttrib[0][$attr];
if ($params['prefixRelPathWith'] ?? false) {
$urlParts = parse_url($tagAttrib[0][$attr]);
if (!$urlParts['scheme'] && $urlParts['path'][0] !== '/') {
.. include:: ../../Includes.txt
Breaking: #96501 - prefixLocalAnchors option in HTMLParser removed
See :issue:`96501`
The property `prefixLocalAnchors` in TypoScript's HTMLParser
is removed without substitution.
This is a leftover from times before there was Site Handling
and absolute URLs, related to config.prefixLocalAnchors which was
removed in TYPO3 v8.
The option has many side-effects such as relying on the request
when parsing HTML (which behaves differently in TYPO3 Backend
and in Frontend).
Setting this TypoScript option has no effect anymore.
Affected Installations
TYPO3 installation having TypoScript configured with this
option activated.
.. index:: Frontend, TypoScript, NotScanned, ext:frontend
\ No newline at end of file
......@@ -3078,17 +3078,6 @@ Is the value "global" then true nesting in relation to other tags marked for "gl
<property name="list" type="stringList">
<description><![CDATA[Attribute value must be in this list. If not, the value is set to the first element.]]></description>
<property name="prefixLocalAnchors" type="integer">
<description><![CDATA[If the first char is a "#" character (anchor of fx. <a> tags) this will prefix either a relative or absolute path.
If the value is "1" you will get the absolute path ($GLOBALS['TYPO3_REQUEST']->getAttribute('normalizedParams')->getRequestUrl())
If the value is "2" you will get the relative path (stripping of $GLOBALS['TYPO3_REQUEST']->getAttribute('normalizedParams')->getSiteUrl())
...fixAttrib.href.prefixLocalAnchors = 1]]></description>
<property name="prefixRelPathWith" type="string">
......@@ -653,7 +653,6 @@
'preCObject': kw('preCObject'),
'prefix': kw('prefix'),
'prefixComment': kw('prefixComment'),
'prefixLocalAnchors': kw('prefixLocalAnchors'),
'prefixRelPathWith': kw('prefixRelPathWith'),
'preIfEmptyListNum': kw('preIfEmptyListNum'),
'preLineBlanks': kw('preLineBlanks'),
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