Bug #14530 » 0000750-urlfix.diff
typo3_src-3.7.0/typo3/class.alt_menu_functions.inc 2005-02-05 21:48:46.000000000 +0100 | ||
---|---|---|
$label = $LANG->moduleLabels['tabs'][$subKey];
|
||
$label_descr = ' title="'.htmlspecialchars($LANG->moduleLabels['labels'][$subKey.'label']).'"';
|
||
$flabel = htmlspecialchars($label);
|
||
$origLink = $link;
|
||
$origLink = $this->cleanupLInk($link);
|
||
if ($link && $prefix) $link=$prefix.rawurlencode($link);
|
||
|
||
// Setting additional JavaScript if frameset script:
|
||
... | ... | |
}
|
||
|
||
/**
|
||
* Cleans link url's so they dont look like something/../ ie. where you
|
||
* go into a directory and then back out.
|
||
* The problem with these links are that some firewalls think they look
|
||
* like attempts to download illegal files. (and it is a waste of tcp traffic)
|
||
*
|
||
* @param string Link URL
|
||
* @return string
|
||
*/
|
||
function cleanupLink($link) {
|
||
if (preg_match('/%2F/',$link)) {
|
||
$link = str_replace ( '%2F', '/', $link);
|
||
while (strstr($link,'/../')) {
|
||
$link = preg_replace('/\w+\/\.\.\//','',$link);
|
||
}
|
||
$link = str_replace ( '/','%2F', $link);
|
||
}
|
||
while (strstr($link,'/../')) {
|
||
$link = preg_replace('/\w+\/\.\.\//','',$link);
|
||
}
|
||
return $link;
|
||
}
|
||
|
||
/**
|
||
* Appends a '?' if there is none in the string already
|
||
*
|
||
* @param string Link URL
|
||
* @return string
|
||
*/
|
||
function wrapLinkWithAB($link) {
|
||
$link = $this->cleanupLink($link);
|
||
if (!strstr($link,'?')) {
|
||
return $link.'?';
|
||
} else return $link;
|