[TYPO3-core] RFC: Link from GoogleAdWords to typo3-based site fails due wrong alias handling
Dmitry Dulepov
typo3 at accio.lv
Sat Aug 19 19:08:10 CEST 2006
Hi!
One more +1, please? This is really simple patch...
Dmitry Dulepov wrote:
> Hi!
>
> This is SVN patch request.
>
> Ref: http://bugs.typo3.org/view.php?id=4037
>
> Branches: 4.0 and trunk
>
> Summary: Google AdWords adds parameter to the destination URL to help
> site owners identify visits from AdWords. URL looks like:
> "http://berni.calis.lv/?gclid=COjNhtPk3oYCFQZWMAodOVur4w". Unfortunately
> setIDfromArgV() function in tslib_fe tries to use the first parameter
> block in query string as alias. Thus if query string does not start with
> ampersand character (which is wrong anyway!), it will treat
> "gclid=COjNhtPk3oYCFQZWMAodOVur4w" as alias and typo3 will display "not
> found" message.
>
> Solution: since aliases cannot contain equals sign, check for this sign
> and do not treat parameter block as alias. Patch is tested on the live
> site.
>
> Note: it seems that such urls do not fail always. They work without this
> patch on my localhost but do not work on production server. In any case
> I think this patch makes better detection for aliases than current code.
> It also solves ugly "http://something/?&no_cache=1" and makes possible
> to use correct "http://something/?no_cache=1"
>
>
> ------------------------------------------------------------------------
>
> Index: typo3/sysext/cms/tslib/class.tslib_fe.php
> ===================================================================
> --- typo3/sysext/cms/tslib/class.tslib_fe.php (revision 1675)
> +++ typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
> @@ -1183,7 +1183,7 @@
> if (!$this->id) {
> list($theAlias) = explode('&',t3lib_div::getIndpEnv('QUERY_STRING'));
> $theAlias = trim($theAlias);
> - $this->id = $theAlias ? $theAlias : 0;
> + $this->id = ($theAlias != '' && strpos($theAlias, '=') === false) ? $theAlias : 0;
> }
> }
>
--
Dmitry Dulepov
ACCIO Ltd, Latvia
http://accio.lv/en/
"It is our choices, that show what we truly are,
far more than our abilities." (A.P.W.B.D.)
More information about the TYPO3-team-core
mailing list