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 #1

Updated by Stefan Neufeind over 15 years ago

While the patch can be seen as a workaround, maybe we should define an internal format for creating link-tags with additional parameters, e.g.

<LINK 18?abc> or together with a content-element-id <LINK 18?abc#222>

Might that find consent?

Actions #2

Updated by Stefan Neufeind over 15 years ago

Fix for the fix ... checking for '?' is wrong, as you might have guessed. Correct is:

--- 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']:'');

Actions #3

Updated by Stefan Neufeind over 15 years ago

Still valid/needed for 4.2.6. Please let me know if you which an updated patch against 4.2.6 or something. Any chance to maybe still get this rolled into 4.3?

Actions #4

Updated by Alban Cousinie almost 15 years ago

The issue is present in Typo3 4.2.8 as well

Actions #5

Updated by Stefan Neufeind over 14 years ago

Against 4.3.0:

--- class.t3lib_parsehtml_proc.orig.php 2009-11-30 10:29:44.000000000 0100
++ class.t3lib_parsehtml_proc.php 2010-02-16 11:23:00.000000000 0100
@ -1555,7 +1555,8 @
$pp = explode('id=',$uP['query']);
$parameters = explode('&', $pp1);
$id = array_shift($parameters);
- if ($id) {
//if ($id) {
+ if (($id) && (strpos($id,'&') === false)) {
$info['pageid']=$id;
$info['cElement']=$uP['fragment'];
$info['url']=$id.($info['cElement']?'#'.$info['cElement']:'');

Actions #6

Updated by Stefan Neufeind over 14 years ago

related are as well: #19576 and #19576

Actions #7

Updated by Alexander Opitz over 11 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

Actions #8

Updated by Alexander Opitz almost 11 years ago

  • Status changed from Needs Feedback to Closed
  • Is Regression set to No

No feedback for over 90 days.

Actions

Also available in: Atom PDF