Fixed bug #12295: Cleaning config_default, exclude values from being listed in instal...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_tceforms_fe.php
index 8c853d7..71fe91c 100644 (file)
@@ -138,8 +138,8 @@ class t3lib_TCEforms_FE extends t3lib_TCEforms {
        public function loadJavascriptLib($lib) {
                /** @var $pageRenderer t3lib_PageRenderer */
                $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
-               $pageRenderer->addJsLibrary($lib, $this->backPath . $lib);
-               
+               $pageRenderer->addJsLibrary($lib, $this->prependBackPath($lib));
+
        }
 
        /**
@@ -154,7 +154,7 @@ class t3lib_TCEforms_FE extends t3lib_TCEforms {
        public function addStyleSheet($key, $href, $title='', $relation='stylesheet') {
                /** @var $pageRenderer t3lib_PageRenderer */
                $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
-               $pageRenderer->addCssFile($this->backPath . $href, $relation, 'screen', $title);
+               $pageRenderer->addCssFile($this->prependBackPath($href), $relation, 'screen', $title);
         }
 
        /**
@@ -170,6 +170,21 @@ class t3lib_TCEforms_FE extends t3lib_TCEforms {
                $GLOBALS['SOBE'] = new stdClass();
                $GLOBALS['SOBE']->doc = $GLOBALS['TBE_TEMPLATE'];
        }
+
+       /**
+        * Prepends backPath to given URL if it's not an absolute URL
+        *
+        * @param string $url
+        * @return string
+        */
+       private function prependBackPath($url) {
+               if (strpos($url, '://') !== FALSE || substr($url, 0, 1) === '/') {
+                       return $url;
+               } else {
+                       return $this->backPath . $url;
+               }
+
+       }
 }
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms_fe.php']) {