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
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72945

Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
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'])) {
unset($tagAttrib[0][$attr]);
}
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`
Description
===========
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).
Impact
======
Setting this TypoScript option has no effect anymore.
Affected Installations
======================
TYPO3 installation having TypoScript configured with this
option activated.
Migration
=========
None.
.. 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>
<default><![CDATA[
]]></default>
</property>
<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())
Example:
...fixAttrib.href.prefixLocalAnchors = 1]]></description>
<default><![CDATA[
]]></default>
</property>
<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