Project

General

Profile

Actions

Bug #19706

closed

Internal links with additional parameters "destroyed" when saving content-elements

Added by Stefan Neufeind over 15 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-12-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Create a content-element, disable RTE and directly insert this code:
<p><a href="http://example.com/index.php?id=18&amp;amp;abc=def&quot;&gt;123&lt;/a&gt;&lt;/p>

This link works if opened in a browser. However when saving that content-element the link gets destroyed.

Reason is that the "external" URL is parsed into a <LINK ...>-statement (internal link). However there is (afaik) no defined way to attach additional parameters. There is only <LINK 18> or <LINK 18#14245> (link to a specific content-element).
The above link gets parsed into a pageid "18&abc=def" which then is a "non existant page", gets rendered with a yellow background ("no page found"-error) etc.

That parsing is done in t3lib/class.t3lib_parsehtml_proc.php

Reason for having such "broken" links in content-elements is that they were used in the past in some typo3-installation. The page always looked fine and worked. However when the content-elements are opened and saved again the links get destroyed. It would be good to at least have a "workaround" for not destroying them.

Problem still exists in 4.2.3. A simple patch/workaround which was created against 4.2.2 is attached below. This one simply checks if there a question-mark in the id-field (which can't be right) and in that case it doesn't try to parse the URL into an internal link but simply leaves it as an "external" link for the moment.

--- class.t3lib_parsehtml_proc.orig.php 2008-12-16 16:27:27.000000000 0100
++ class.t3lib_parsehtml_proc.php 2008-12-17 00:54:03.000000000 0100
@ -1541,7 +1541,8 @
} elseif (!trim($uP['path']) || !strcmp($uP['path'],'index.php')) {
$pp = explode('id=',$uP['query']);
$id = trim($pp1);
- if ($id) {
// if ($id) {
+ if (($id) && (strpos($id,'?') !== false)) {
$info['pageid']=$id;
$info['cElement']=$uP['fragment'];
$info['url']=$id.($info['cElement']?'#'.$info['cElement']:'');
(issue imported from #M9959)


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #15736: In RTE htmlArea, unable to do an internal link with several parametersClosedStanislas Rolland2006-02-27

Actions
Related to TYPO3 Core - Bug #19576: URL parameters cause RTE errorClosedStanislas Rolland2008-11-05

Actions
Actions

Also available in: Atom PDF