Bug #22443
closedWrong path as return value from function listURL in class.db_list.inc
0%
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='') {
- patch by bjorn.wendeler@burnabit.com
- 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)