Fixed bug #5117: typolink: cHash corrupted due to linkVars
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 10 Jun 2010 08:49:20 +0000 (08:49 +0000)
committerDmitry Dulepov <dmitry.dulepov@gmail.com>
Thu, 10 Jun 2010 08:49:20 +0000 (08:49 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2@7864 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php

index eee1676..3c4ce0c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-06-10  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
+
+       * Fixed bug #5117: typolink: cHash corrupted due to linkVars (together with Pierre Dudoret (Popy))
+
 2010-05-27  Xavier Perseguers  <typo3@perseguers.ch>
 
        * Fixed bug #13934: Side-effect of substr in t3lib_cs (thanks to Rens Admiraal)
index c563c1d..7dea37b 100755 (executable)
@@ -5302,8 +5302,12 @@ class tslib_cObj {
                                                if (substr($addQueryParams,0,1)!='&')           {
                                                        $addQueryParams = '';
                                                } elseif ($conf['useCacheHash']) {      // cache hashing:
-                                                       $pA = t3lib_div::cHashParams($addQueryParams.$GLOBALS['TSFE']->linkVars);       // Added '.$this->linkVars' dec 2003: The need for adding the linkVars is that they will be included in the link, but not the cHash. Thus the linkVars will always be the problem that prevents the cHash from working. I cannot see what negative implications in terms of incompatibilities this could bring, but for now I hope there are none. So here we go... (- kasper)
-                                                       $addQueryParams.= '&cHash='.t3lib_div::shortMD5(serialize($pA));
+                                                               // Mind the order below! See http://bugs.typo3.org/view.php?id=5117
+                                                       $params = $GLOBALS['TSFE']->linkVars . $addQueryParams;
+                                                       if ($params) {
+                                                               $pA = t3lib_div::cHashParams($params);
+                                                               $addQueryParams.= '&cHash='.t3lib_div::shortMD5(serialize($pA));
+                                                       }
                                                }
 
                                                $tCR_domain = '';