Project

General

Profile

Actions

Bug #22443

closed

Wrong path as return value from function listURL in class.db_list.inc

Added by Björn Wendeler over 14 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-04-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

One of our clients reported a broken link when clicking onto the icon named pildown.gif in db_layout.php to jump to another set if records. The click onto the icon resolves in a 404 error due to a wrong link to db_layout.php.

After some re-engineering I found a method fwd_rwd_HTML() in class.t3lib_recordlist.php that creates the (broken) link by using the method listURL(). I was assuming, that fwd_rwd_HTML() would use listURL() from the same file class.t3lib_recordlist.php but instead I found that the method used by fwd_rwd_HTML() resides in typo3/class.db_list.inc.

The method listURL() in class.db_list.inc returns a path by prefixing the script with $GLOBALS['BACK_PATH']. $GLOBALS['BACK_PATH'] holds the wrong relative path (../../..).

After removing $GLOBALS['BACK_PATH'] from the return value, the link is working again.

We experienced this misbehaviour in an earlier version of TYPO3 as well but didn't file a bugreport yet.

Here's the complete method including my changes:

/**
 * Creates the URL to this script, including all relevant GPvars
 * Fixed GPvars are id, table, imagemode, returlUrl, search_field, search_levels and showLimit
 * The GPvars "sortField" and "sortRev" are also included UNLESS they are found in the $exclList variable.
 *
 * @param    string        Alternative id value. Enter blank string for the current id ($this->id)
 * @param    string        Tablename to display. Enter "-1" for the current table.
 * @param    string        Commalist of fields NOT to include ("sortField" or "sortRev")
 * @return    string        URL
*/
function listURL($altId='',$table=-1,$exclList='') {
  1. patch by
  2. to fix wrong path to db_layout.php
/*
return $GLOBALS['BACK_PATH'] . $this->script.
'?id='.(strcmp($altId,'')?$altId:$this->id).
'&table='.rawurlencode($table==-1?$this->table:$table).
($this->thumbs?'&imagemode='.$this->thumbs:'').
($this->returnUrl?'&returnUrl='.rawurlencode($this->returnUrl):'').
($this->searchString?'&search_field='.rawurlencode($this->searchString):'').
($this->searchLevels?'&search_levels='.rawurlencode($this->searchLevels):'').
($this->showLimit?'&showLimit='.rawurlencode($this->showLimit):'').
($this->firstElementNumber?'&pointer='.rawurlencode($this->firstElementNumber):'').
((!$exclList || !t3lib_div::inList($exclList,'sortField')) && $this->sortField?'&sortField='.rawurlencode($this->sortField):'').
((!$exclList || !t3lib_div::inList($exclList,'sortRev')) && $this->sortRev?'&sortRev='.rawurlencode($this->sortRev):'')
;
*/
return $this->script.
'?id='.(strcmp($altId,'')?$altId:$this->id).
'&table='.rawurlencode($table==-1?$this->table:$table).
($this->thumbs?'&imagemode='.$this->thumbs:'').
($this->returnUrl?'&returnUrl='.rawurlencode($this->returnUrl):'').
($this->searchString?'&search_field='.rawurlencode($this->searchString):'').
($this->searchLevels?'&search_levels='.rawurlencode($this->searchLevels):'').
($this->showLimit?'&showLimit='.rawurlencode($this->showLimit):'').
($this->firstElementNumber?'&pointer='.rawurlencode($this->firstElementNumber):'').
((!$exclList || !t3lib_div::inList($exclList,'sortField')) && $this->sortField?'&sortField='.rawurlencode($this->sortField):'').
((!$exclList || !t3lib_div::inList($exclList,'sortRev')) && $this->sortRev?'&sortRev='.rawurlencode($this->sortRev):'')
;
}
(issue imported from #M14092)

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #22864: Unable to show tt_address records >=1001 in site modulClosed2010-06-11

Actions
Related to TYPO3 Core - Bug #21955: Broken forward/previous link in typo3-page-stdlist (/typo3/sysext/cms/layout/db_layout.php)Closed2010-01-14

Actions
Actions

Also available in: Atom PDF