@anonymous-piwik-user opened this Issue on June 22nd 2009

When trying to detect if we have a campaign keyword, the code calls

Piwik_Common::getParameterFromQueryString($this->currentUrlParse['query'], $campaignKeywordVariableName);

the $urlQuery is: ariba_campaign=Adwords-CPC&ariba_kwd=My killer keyword
and the $parameter is ariba_kwd

Note that the &amp was inserted when calling parse_url

The comment of the function Piwik_Common::getParameterFromQueryString:

 * <a class='mention' href='https://github.com/param'>@param</a> string $urlQuery result of parse_url()['query'] and htmlentitied (& is &amp;) eg. module=test&amp;action=toto or ?page=test

and it does appear that since the "&" is now & it has been htmlspecialchar'ed.

However since the split happens on &, we get &ariba_kwd=My killer keyword and do not match ariba_kwd

Note that this comment indicates that this data is expected in this format:

/**
 * Returns the value of a GET parameter $parameter in an URL query $urlQuery
 *
 * <a class='mention' href='https://github.com/param'>@param</a> string $urlQuery result of parse_url()['query'] and htmlentitied (& is &amp;) eg. module=test&amp;action=toto or ?page=test
 * <a class='mention' href='https://github.com/param'>@param</a> string $param
 *
 * <a class='mention' href='https://github.com/return'>@return</a> string|bool Parameter value if found (can be the empty string!), false if not found
 */
static public function getParameterFromQueryString( $urlQuery, $parameter)

I might try to fix this in my local copy, but I'm new enough to Piwik to be leery of anything more at the moment.

@robocoder commented on June 22nd 2009 Contributor

dupe #697; fixed in svn

This Issue was closed on August 14th 2009
Powered by GitHub Issue Mirror