菜单

RTE文件相对路径转绝对路径

2010年09月10日 - typoscript

Attached patch adds a setting RTE.default.proc.preserveExternalURLs, which if set to 1 fixes this issue. If someone needs the URLs to be relative, it can be set to 0.

Index: t3lib/class.t3lib_parsehtml_proc.php
===================================================================
--- t3lib/class.t3lib_parsehtml_proc.php
+++ t3lib/class.t3lib_parsehtml_proc.php
@@ -1549,7 +1549,9 @@
 				$uP=parse_url($info['relUrl']);
 
 				if (!strcmp('#'.$siteUrl_parts['fragment'],$info['relUrl'])) {
-					$info['url']=$info['relUrl'];
+					if ($this->tsConfig['proc.']['preserveExternalURLs'] != 1) {
+						$info['url']=$info['relUrl'];
+					}
 					$info['type']='anchor';
 				} elseif (!trim($uP['path']) || !strcmp($uP['path'],'index.php'))	{
 					$pp = explode('id=',$uP['query']);
@@ -1563,7 +1565,9 @@
 						$info['query'] = $parameters[0]?'&'.implode('&', $parameters):'';
 					}
 				} else {
-					$info['url']=$info['relUrl'];
+					if ($this->tsConfig['proc.']['preserveExternalURLs'] != 1) {
+						$info['url']=$info['relUrl'];
+					}
 					$info['type']='file';
 				}
 			} else {
Index: typo3/sysext/rtehtmlarea/res/proc/pageTSConfig.txt
===================================================================
--- typo3/sysext/rtehtmlarea/res/proc/pageTSConfig.txt
+++ typo3/sysext/rtehtmlarea/res/proc/pageTSConfig.txt
@@ -145,6 +145,9 @@
 			## AVOID CONTENT BEING HSC'ed TWICE
 		htmlSpecialChars = 0
 	}
+	
+	## Leave external URLs as set. If set to 0, local URLs will be transformed to relative paths.
+	preserveExternalURLs = 1
 }
 
 	## Use same RTE processing rules in FE


http://bugs.typo3.org/view.php?id=9455

发表评论

电子邮件地址不会被公开。 必填项已用*标注