Fixed bug #9741: wrong anchor links with absRefPrefix option enabled
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Sun, 21 Dec 2008 16:54:06 +0000 (16:54 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Sun, 21 Dec 2008 16:54:06 +0000 (16:54 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2@4586 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index ec7de8c..8fe3270 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
 2008-12-18  Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed bug #9947: gzip compression does not work in BE at all
+       * Fixed bug #9741: wrong anchor links with absRefPrefix option enabled (tanks to Stefan Galinski)
 
 2008-12-18  Ernesto Baschny  <ernst@cron-it.de>
 
index 4280fc0..0f6b033 100755 (executable)
@@ -4117,7 +4117,7 @@ if (version == "n3") {
         * @return      void            Works directly on $this->content
         */
        function prefixLocalAnchorsWithScript() {
-               $scriptPath = substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL')));
+               $scriptPath = $GLOBALS['TSFE']->absRefPrefix . substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL')));
                $originalContent = $this->content;
                $this->content = preg_replace('/(<(?:a|area).*?href=")(#[^"]*")/i', '${1}' . htmlspecialchars($scriptPath) . '${2}', $originalContent);         
                        // There was an error in the call to preg_replace, so keep the original content (behavior prior to PHP 5.2)
index 04ca721..5581ef4 100755 (executable)
@@ -649,7 +649,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                                                if (!$type)     $type = 'text/javascript';
 
                                                $GLOBALS['TSFE']->content.='
-       <script src="'.htmlspecialchars($ss).'" type="'.htmlspecialchars($type).'"></script>';
+       <script src="' . htmlspecialchars($GLOBALS['TSFE']->absRefPrefix . $ss) . '" type="' . htmlspecialchars($type) . '"></script>';
                                        }
                                }
                        }