Index: t3lib/class.t3lib_clipboard.php
===================================================================
--- t3lib/class.t3lib_clipboard.php (revision 4425)
+++ t3lib/class.t3lib_clipboard.php (working copy)
@@ -338,18 +338,18 @@
}
// Edit:
if (!$this->fileMode && $elCount) {
- $opt[]='';
+ $opt[]='';
}
// Delete:
if ($elCount) {
if($GLOBALS['BE_USER']->jsConfirmation(4)) {
$js = "
if(confirm(".$GLOBALS['LANG']->JScharCode(sprintf($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.deleteClip'),$elCount)).")){
- window.location.href='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(window.location.href);
+ window.location.href='" . $this->deleteUrl(0, $this->fileMode ? 1 : 0) . "&redirect='+top.rawurlencodeAndRemoveSiteUrl(window.location.href);
}
";
} else {
- $js = " window.location.href='".$this->deleteUrl(0,$this->fileMode?1:0)."&redirect='+top.rawurlencode(window.location.href); ";
+ $js = " window.location.href='" . $this->deleteUrl(0, $this->fileMode ? 1 : 0) . "&redirect='+top.rawurlencodeAndRemoveSiteUrl(window.location.href); ";
}
$opt[]='';
}
Index: typo3/alt_clickmenu.php
===================================================================
--- typo3/alt_clickmenu.php (revision 4425)
+++ typo3/alt_clickmenu.php (working copy)
@@ -425,7 +425,7 @@
function urlRefForCM($url,$retUrl='',$hideCM=1,$overrideLoc='') {
$loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
$editOnClick= ($overrideLoc ? 'var docRef='.$overrideLoc : 'var docRef=(top.content.list_frame)?top.content.list_frame:'.$loc).'; docRef.location.href=top.TS.PATH_typo3+\''.$url.'\''.
- ($retUrl?"+'&".$retUrl."='+top.rawurlencode(".$this->frameLocation('docRef.document').')':'').';'.
+ ($retUrl ? "+'&" . $retUrl . "='+top.rawurlencodeAndRemoveSiteUrl(" . $this->frameLocation('docRef.document') . ')' :'') . ';' .
($hideCM?'return hideCM();':'');
return $editOnClick;
}
@@ -476,7 +476,7 @@
} else {
$conf = $loc;
}
- $editOnClick = 'if('.$conf.'){'.$loc.'.location.href=top.TS.PATH_typo3+\''.$this->clipObj->pasteUrl($table,$uid,0).'&redirect=\'+top.rawurlencode('.$this->frameLocation($loc.'.document').'); hideCM();}';
+ $editOnClick = 'if(' . $conf . '){' . $loc . '.location.href=top.TS.PATH_typo3+\'' . $this->clipObj->pasteUrl($table, $uid, 0) . '&redirect=\'+top.rawurlencodeAndRemoveSiteUrl(' . $this->frameLocation($loc . '.document') . '); hideCM();}';
return $this->linkItem(
$this->label('paste'.$type),
@@ -678,11 +678,11 @@
if ($BE_USER->uc['classicPageEditMode'] || !t3lib_extMgm::isLoaded('cms')) {
$addParam='&editRegularContentFromId='.intval($this->iParts[1]);
} else {
- $editOnClick="top.fsMod.recentIds['web']=".intval($this->iParts[1]).";top.goToModule('".$pageModule."',1);";
+ $editOnClick='if(' . $loc . '){' . $loc . ".location.href=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencodeAndRemoveSiteUrl(" . $this->frameLocation($loc . '.document') . ")+'&edit[".$table."][".$uid."]=edit".$addParam."';}";
}
}
if (!$editOnClick) {
- $editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'&edit[".$table."][".$uid."]=edit".$addParam."';}";
+ $editOnClick='if(' . $loc . '){' . $loc . ".location.href=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencodeAndRemoveSiteUrl(" . $this->frameLocation($loc . '.document') . ")+'&edit[".$table."][".$uid."]=edit".$addParam."';}";
}
return $this->linkItem(
@@ -705,7 +705,7 @@
$loc='top.content'.(!$this->alwaysContentFrame?'.list_frame':'');
$editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'".
($this->listFrame?
- "alt_doc.php?returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'&edit[".$table."][-".$uid."]=new'":
+ "alt_doc.php?returnUrl='+top.rawurlencodeAndRemoveSiteUrl(" . $this->frameLocation($loc . '.document') . ")+'&edit[".$table."][-".$uid."]=new'":
'db_new.php?id='.intval($uid)."'").
';}';
@@ -733,7 +733,7 @@
} else {
$conf = '1==1';
}
- $editOnClick='if('.$loc." && ".$conf." ){".$loc.".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
+ $editOnClick = 'if(' . $loc . " && " . $conf . " ){" . $loc . ".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencodeAndRemoveSiteUrl(" . $this->frameLocation($loc . '.document') . ")+'".
"&cmd[".$table.']['.$uid.'][delete]=1&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
return $this->linkItem(
@@ -802,7 +802,7 @@
$uid = $rec['_ORIG_uid'] ? $rec['_ORIG_uid'] : $rec['uid'];
$editOnClick='';
$loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
- $editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
+ $editOnClick = 'if(' . $loc . '){' . $loc . ".location.href=top.TS.PATH_typo3+'tce_db.php?redirect='+top.rawurlencodeAndRemoveSiteUrl(" . $this->frameLocation($loc . '.document') . ")+'" .
"&data[".$table.']['.$uid.']['.$flagField.']='.($rec[$flagField]?0:1).'&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
return $this->linkItem(
@@ -914,7 +914,7 @@
function FILE_launch($path,$script,$type,$image,$noReturnUrl=FALSE) {
$loc='top.content'.(!$this->alwaysContentFrame?'.list_frame':'');
- $editOnClick='if('.$loc.'){'.$loc.".location.href=top.TS.PATH_typo3+'".$script.'?target='.rawurlencode($path).($noReturnUrl ? "'" : "&returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")").";}";
+ $editOnClick = 'if(' . $loc . '){' . $loc . ".location.href=top.TS.PATH_typo3+'".$script.'?target=' . rawurlencode($path) . ($noReturnUrl ? "'" : "&returnUrl='+top.rawurlencodeAndRemoveSiteUrl(" . $this->frameLocation($loc . '.document') . ")") . ";}";
return $this->linkItem(
$this->label($type),
@@ -965,7 +965,7 @@
} else {
$conf = '1==1';
}
- $editOnClick='if('.$loc." && ".$conf." ){".$loc.".location.href=top.TS.PATH_typo3+'tce_file.php?redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'".
+ $editOnClick = 'if(' . $loc . " && " . $conf . " ){" . $loc . ".location.href=top.TS.PATH_typo3+'tce_file.php?redirect='+top.rawurlencodeAndRemoveSiteUrl(" . $this->frameLocation($loc . '.document') . ")+'" .
"&file[delete][0][data]=".rawurlencode($path).'&vC='.$GLOBALS['BE_USER']->veriCode()."';hideCM();}";
return $this->linkItem(
@@ -994,7 +994,7 @@
}
$editOnClick='if('.$conf.'){'.$loc.".location.href=top.TS.PATH_typo3+'".$this->clipObj->pasteUrl('_FILE',$path,0).
- "&redirect='+top.rawurlencode(".$this->frameLocation($loc.'.document').'); hideCM();}';
+ "&redirect='+top.rawurlencodeAndRemoveSiteUrl(" . $this->frameLocation($loc . '.document') .'); hideCM();}';
return $this->linkItem(
$this->label('pasteinto'),
@@ -1082,7 +1082,7 @@
$negativeSign = ($into == 'into') ? '' : '-';
$editOnClick='';
$loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
- $editOnClick='if('.$loc.'){'.$loc.'.document.location=top.TS.PATH_typo3+"tce_db.php?redirect="+top.rawurlencode('.$this->frameLocation($loc.'.document').')+"'.
+ $editOnClick = 'if(' . $loc . '){' . $loc . '.document.location=top.TS.PATH_typo3+"tce_db.php?redirect="+top.rawurlencodeAndRemoveSiteUrl(' . $this->frameLocation($loc . '.document') . ')+"' .
'&cmd[pages]['.$srcUid.']['.$action.']='.$negativeSign.$dstUid.'&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode().'";hideCM();}';
return $this->linkItem(
@@ -1106,7 +1106,7 @@
function dragDrop_copymovefolder($srcPath,$dstPath,$action) {
$editOnClick='';
$loc='top.content'.($this->listFrame && !$this->alwaysContentFrame ?'.list_frame':'');
- $editOnClick='if('.$loc.'){'.$loc.'.document.location=top.TS.PATH_typo3+"tce_file.php?redirect="+top.rawurlencode('.$this->frameLocation($loc.'.document').')+"'.
+ $editOnClick = 'if(' . $loc . '){' . $loc . '.document.location=top.TS.PATH_typo3+"tce_file.php?redirect="+top.rawurlencodeAndRemoveSiteUrl(' . $this->frameLocation($loc . '.document') .')+"' .
'&file['.$action.'][0][data]='.$srcPath.'&file['.$action.'][0][target]='.$dstPath.'&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode().'";hideCM();}';
return $this->linkItem(
Index: typo3/alt_shortcut.php
===================================================================
--- typo3/alt_shortcut.php (revision 4425)
+++ typo3/alt_shortcut.php (working copy)
@@ -168,7 +168,7 @@
$url = urldecode($this->URL);
// Lookup the title of this page and use it as default description
- $page_id = $this->getLinkedPageId($url);
+ $page_id = $this->getLinkedPageId($url);
if (t3lib_div::testInt($page_id)) {
if (preg_match('/\&edit\[(.*)\]\[(.*)\]=edit/',$url,$matches)) {
// Edit record
@@ -266,10 +266,10 @@
window.location.href="alt_shortcut.php?editShortcut="+uid;
}
function submitEditPage(id) { //
- window.location.href="alt_shortcut.php?editPage="+top.rawurlencode(id);
+ window.location.href="alt_shortcut.php?editPage="+top.rawurlencodeAndRemoveSiteUrl(id);
}
function changeWorkspace(workspaceId) { //
- window.location.href="alt_shortcut.php?changeWorkspace="+top.rawurlencode(workspaceId);
+ window.location.href="alt_shortcut.php?changeWorkspace="+top.rawurlencodeAndRemoveSiteUrl(workspaceId);
}
function changeWorkspacePreview(newstate) { //
window.location.href="alt_shortcut.php?changeWorkspacePreview="+newstate;
Index: typo3/backend.php
===================================================================
--- typo3/backend.php (revision 4425)
+++ typo3/backend.php (working copy)
@@ -334,7 +334,7 @@
/**
* Function similar to PHPs rawurlencode();
*/
- function rawurlencode(str) { //
+ function rawurlencode(str) {
var output = escape(str);
output = str_replace("*","%2A", output);
output = str_replace("+","%2B", output);
@@ -342,8 +342,16 @@
output = str_replace("@","%40", output);
return output;
}
-
+
/**
+ * Function to similar to PHPs rawurlencode() which removes TYPO3_SITE_URL;
+ */
+ function rawurlencodeAndRemoveSiteUrl(str) { //
+ var siteUrl = "' . t3lib_div::getIndpEnv('TYPO3_SITE_URL') . '";
+ return rawurlencode(str_replace(siteUrl, \'\', str));
+ }
+
+ /**
* String-replace function
*/
function str_replace(match,replace,string) { //
Index: typo3/class.alt_menu_functions.inc
===================================================================
--- typo3/class.alt_menu_functions.inc (revision 4425)
+++ typo3/class.alt_menu_functions.inc (working copy)
@@ -288,7 +288,7 @@
// Setting additional JavaScript if frameset script:
$addJS = '';
- if ($moduleInfo['navFrameScript']) {$addJS="+'&id='+top.rawurlencode(top.fsMod.recentIds['".$moduleName."'])";}
+ if ($moduleInfo['navFrameScript']) {$addJS = "+'&id='+top.rawurlencodeAndRemoveSiteUrl(top.fsMod.recentIds['" . $moduleName . "'])";}
// If there is a script to link to (and linking is not disabled.
if ($link && !$dontLink) {
Index: typo3/classes/class.modulemenu.php
===================================================================
--- typo3/classes/class.modulemenu.php (revision 4425)
+++ typo3/classes/class.modulemenu.php (working copy)
@@ -194,7 +194,7 @@
$additionalJavascript = '';
if($moduleData['parentNavigationFrameScript']) {
$parentModuleName = substr($moduleData['name'], 0, strpos($moduleData['name'], '_'));
- $additionalJavascript = "+'&id='+top.rawurlencode(top.fsMod.recentIds['".$parentModuleName."'])";
+ $additionalJavascript = "+'&id='+top.rawurlencodeAndRemoveSiteUrl(top.fsMod.recentIds['" . $parentModuleName . "'])";
}
if($moduleData['link'] && $this->linkModules) {
@@ -409,7 +409,7 @@
// Setting additional JavaScript if frameset script:
$additionalJavascript = '';
if($subModuleData['parentNavigationFrameScript']) {
- $additionalJavascript = "+'&id='+top.rawurlencode(top.fsMod.recentIds['".$parentModuleName."'])";
+ $additionalJavascript = "+'&id='+top.rawurlencodeAndRemoveSiteUrl(top.fsMod.recentIds['" . $parentModuleName . "'])";
}
if($subModuleData['link'] && $this->linkModules) {
@@ -429,7 +429,7 @@
}
if(!$GLOBALS['BE_USER']->uc['condensedMode'] && $subModuleData['parentNavigationFrameScript']) {
- $additionalJavascript = "+'&id='+top.rawurlencode(top.fsMod.recentIds['".$parentModuleName."'])";
+ $additionalJavascript = "+'&id='+top.rawurlencodeAndRemoveSiteUrl(top.fsMod.recentIds['" . $parentModuleName . "'])";
$submoduleNavigationFrameScript = $subModuleData['navigationFrameScript'] ? $subModuleData['navigationFrameScript'] : $subModuleData['parentNavigationFrameScript'];
$submoduleNavigationFrameScript = t3lib_div::resolveBackPath($submoduleNavigationFrameScript);
Index: typo3/classes/class.shortcutmenu.php
===================================================================
--- typo3/classes/class.shortcutmenu.php (revision 4425)
+++ typo3/classes/class.shortcutmenu.php (working copy)
@@ -496,7 +496,7 @@
$shortcutName = 'Shortcut'; // default name
$shortcutNamePrepend = '';
- $url = urldecode(t3lib_div::_POST('url'));
+ $url = t3lib_div::_POST('url');
$module = t3lib_div::_POST('module');
$motherModule = t3lib_div::_POST('motherModName');
@@ -518,10 +518,10 @@
} else {
$shortcut['type'] = 'other';
}
-
+
// Lookup the title of this page and use it as default description
- $pageId = $this->getLinkedPageId($url);
-
+ $pageId = $shortcut['recordid'] ? $shortcut['recordid'] : $this->getLinkedPageId($url);
+
if(t3lib_div::testInt($pageId)) {
$page = t3lib_BEfunc::getRecord('pages', $pageId);
if(count($page)) {
@@ -532,15 +532,16 @@
$shortcutName = $shortcutNamePrepend.' '.$LANG->sL($TCA[$shortcut['table']]['ctrl']['title']).' ('.$page['title'].')';
}
}
- } else {
- if (preg_match('/\/$/', $pageId)) {
+ } else {
+ $dirName = urldecode($pageId);
+ if (preg_match('/\/$/', $dirName)) {
// if $pageId is a string and ends with a slash,
// assume it is a fileadmin reference and set
// the description to the basename of that path
- $shortcutName .= basename($pageId);
+ $shortcutName .= ' ' . basename($dirName);
}
}
-
+
// adding the shortcut
if($module && $url) {
$fieldValues = array(
@@ -704,7 +705,7 @@
' AND '.$this->perms_clause :
'';
- $sqlQueryParts = array(
+ $sqlQueryParts = array(
'SELECT' => implode(',', $selectFields),
'FROM' => $table,
'WHERE' => 'uid IN ('.$recordid.') '.$permissionClause.
Index: typo3/js/backendsearch.js
===================================================================
--- typo3/js/backendsearch.js (revision 4425)
+++ typo3/js/backendsearch.js (working copy)
@@ -123,7 +123,7 @@
* calls the actual clear cache URL using an asynchronious HTTP request
*/
invokeSearch: function() {
- new Ajax.Request('alt_shortcut.php?ajax=1&editPage=' + top.rawurlencode($F('search-query')), {
+ new Ajax.Request('alt_shortcut.php?ajax=1&editPage=' + top.rawurlencodeAndRemoveSiteUrl($F('search-query')), {
method: 'get',
requestHeaders: {Accept: 'application/json'},
onSuccess: function(transport) {
Index: typo3/js/workspaces.js
===================================================================
--- typo3/js/workspaces.js (revision 4425)
+++ typo3/js/workspaces.js (working copy)
@@ -28,9 +28,9 @@
function changeWorkspace(workspaceId) {
- window.location.href = 'backend.php?changeWorkspace=' + top.rawurlencode(workspaceId);
+ window.location.href = 'backend.php?changeWorkspace=' + top.rawurlencodeAndRemoveSiteUrl(workspaceId);
}
function changeWorkspacePreview(newstate) {
window.location.href = 'backend.php?changeWorkspacePreview=' + newstate;
-}
\ No newline at end of file
+}