Fixed bug #12247: absRefPrefix is prefixed with external js files
authorSteffen Kamper <info@sk-typo3.de>
Sun, 8 Nov 2009 16:25:46 +0000 (16:25 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sun, 8 Nov 2009 16:25:46 +0000 (16:25 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6379 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_pagegen.php

index 567edb9..fbd059d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-11-08  Steffen Kamper  <info@sk-typo3.de>
+
+       * Fixed bug #12247: absRefPrefix is prefixed with external js files
+
 2009-11-08  Oliver Hader  <oliver@typo3.org>
 
        * Raised feeditadvanced from 0.1.1 to 0.8.0
index 29813ba..5c1a5a9 100644 (file)
@@ -4188,7 +4188,9 @@ if (version == "n3") {
                if ($this->absRefPrefix)        {
                        $this->content = str_replace('"media/', '"'.t3lib_extMgm::siteRelPath('cms').'tslib/media/', $this->content);
                        $this->content = str_replace('"typo3conf/ext/', '"'.$this->absRefPrefix.'typo3conf/ext/', $this->content);
-                       $this->content = str_replace('"typo3/contrib/', '"'.$this->absRefPrefix.'typo3/contrib/', $this->content);
+                       $this->content = str_replace('"' . TYPO3_mainDir . 'contrib/', '"' . $this->absRefPrefix . TYPO3_mainDir . 'contrib/', $this->content);
+                       $this->content = str_replace('"' . TYPO3_mainDir . 'ext/', '"' . $this->absRefPrefix . TYPO3_mainDir . 'ext/', $this->content);
+                       $this->content = str_replace('"' . TYPO3_mainDir . 'sysext/' , '"' . $this->absRefPrefix . TYPO3_mainDir . 'sysext/', $this->content);
                        $this->content = str_replace('"'.$GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], '"'.$this->absRefPrefix.$GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], $this->content);
                        // Process additional directories
                        $directories = t3lib_div::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['additionalAbsRefPrefixDirectories'], true);
index c7e2303..a86020c 100644 (file)
@@ -527,7 +527,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
 
                if (is_array($GLOBALS['TSFE']->pSetup['includeCSS.'])) {
                        foreach ($GLOBALS['TSFE']->pSetup['includeCSS.'] as $key => $CSSfile) {
-                               if (! is_array($CSSfile)) {
+                               if (!is_array($CSSfile)) {
                                        $ss = $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['external'] ? $CSSfile : $GLOBALS['TSFE']->tmpl->getFileName($CSSfile);
                                        if ($ss) {
                                                if ($GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['import']) {
@@ -671,43 +671,45 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                        // JavaScript library files
                if (is_array($GLOBALS['TSFE']->pSetup['includeJSlibs.'])) {
                        foreach ($GLOBALS['TSFE']->pSetup['includeJSlibs.'] as $key => $JSfile) {
-                               $ss = $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['external'] ? $JSfile : $GLOBALS['TSFE']->tmpl->getFileName($JSfile);
-                               if ($ss) {
-                                       $type = $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['type'];
-                                       if (! $type) {
-                                               $type = 'text/javascript';
+                               if (!is_array($JSfile)) {
+                                       $ss = $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['external'] ? $JSfile : $GLOBALS['TSFE']->tmpl->getFileName($JSfile);
+                                       if ($ss) {
+                                               $type = $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['type'];
+                                               if (! $type) {
+                                                       $type = 'text/javascript';
+                                               }
+                                               $pageRenderer->addJsLibrary(
+                                                       htmlspecialchars($key),
+                                                       htmlspecialchars($ss),
+                                                       htmlspecialchars($type),
+                                                       $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['compress'] ? TRUE : FALSE,
+                                                       $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['forceOnTop'] ? TRUE : FALSE,
+                                                       $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['allWrap']
+                                               );
                                        }
-                                       $pageRenderer->addJsLibrary(
-                                               htmlspecialchars($key),
-                                               htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss),
-                                               htmlspecialchars($type),
-                                               $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['compress'] ? TRUE : FALSE,
-                                               $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['forceOnTop'] ? TRUE : FALSE,
-                                               $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['allWrap']
-                                       );
                                }
-
                        }
                }
 
                if (is_array($GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'])) {
                        foreach ($GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'] as $key => $JSfile) {
-                               $ss = $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['external'] ? $JSfile : $GLOBALS['TSFE']->tmpl->getFileName($JSfile);
-                               if ($ss) {
-                                       $type = $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['type'];
-                                       if (! $type) {
-                                               $type = 'text/javascript';
+                               if (!is_array($JSfile)) {
+                                       $ss = $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['external'] ? $JSfile : $GLOBALS['TSFE']->tmpl->getFileName($JSfile);
+                                       if ($ss) {
+                                               $type = $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['type'];
+                                               if (! $type) {
+                                                       $type = 'text/javascript';
+                                               }
+                                               $pageRenderer->addJsFooterLibrary(
+                                                       htmlspecialchars($key),
+                                                       htmlspecialchars($ss),
+                                                       htmlspecialchars($type),
+                                                       $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['compress'] ? TRUE : FALSE,
+                                                       $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['forceOnTop'] ? TRUE : FALSE,
+                                                       $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['allWrap']
+                                               );
                                        }
-                                       $pageRenderer->addJsFooterLibrary(
-                                               htmlspecialchars($key),
-                                               htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss),
-                                               htmlspecialchars($type),
-                                               $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['compress'] ? TRUE : FALSE,
-                                               $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['forceOnTop'] ? TRUE : FALSE,
-                                               $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['allWrap']
-                                       );
                                }
-
                        }
                }
 
@@ -722,7 +724,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                                                        $type = 'text/javascript';
                                                }
                                                $pageRenderer->addJsFile(
-                                                       htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss),
+                                                       htmlspecialchars($ss),
                                                        htmlspecialchars($type),
                                                        $GLOBALS['TSFE']->pSetup['includeJS.'][$key . '.']['compress'] ? TRUE : FALSE,
                                                        $GLOBALS['TSFE']->pSetup['includeJS.'][$key . '.']['forceOnTop'] ? TRUE : FALSE,
@@ -743,7 +745,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                                                        $type = 'text/javascript';
                                                }
                                                $pageRenderer->addJsFooterFile(
-                                                       htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss),
+                                                       htmlspecialchars($ss),
                                                        htmlspecialchars($type),
                                                        $GLOBALS['TSFE']->pSetup['includeFooterJS.'][$key . '.']['compress'] ? TRUE : FALSE,
                                                        $GLOBALS['TSFE']->pSetup['includeJS.'][$key . '.']['forceOnTop'] ? TRUE : FALSE,