News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Erroneous query string appended to URL

Started by DDPaul, July 04, 2008, 00:12:24 AM

Previous topic - Next topic

DDPaul

An erroneous query string is appended to the browser requested URL. Note: this problem effectively invalidates the cookie check (when using firefox/VISTA with cookies disabled).

I spent some time investigating this problem and the virtuemart software behavior is very strange Actually I don't know if this is a virtuemart problem, a joomla problem, or perhaps a problem with apache, php or even a faulty configuration (I couldn't find a configuration problem in the various php.ini files or cfg files but I'm no expert). It may even be a problem with this piece of junk called VISTA that I'm forced to use for my localhost development. However, the bottom line is that the problem only shows up when connecting to the virtuemart shop so this forum seems the appropriate place to report the problem and get some help. In particular, the cookie check doesn't really work because of this problem and as noted below it may cause additional problems.

As noted above apparently erroneous parameters are somehow added to the query string when connecting to the virtuemart shop. Not just the parameter vmcchk=1 is added but also the parameter Itemid=53 is added. This latter addition duplicates the original Itemid but with a different value. Since the new Itemid value is at the end of the query string then that is what is provided to the joomla/virtuemart program via the $_GET array and it overrides the actual requested value. I assume this probably causes additional virtuemart problems.

As a further test I  did a dump of the $_GET, $_POST, $_REQUEST, and $_SERVER arrays using the php var_dump() using the die() functions in order to insure that no redirects were occurring that could falsify my results. I verified that the query string in the $_SERVER array  was altered from the requested url query string prior to any joomla or virtuemart code being run (by using the die function in the root index.php file right after the define( '_JEXEC', 1 ); statement).   Thus the $_GET array was a true reflection of what is in the $_SERVER array.

The strange results are as follows:

When connecting to the joomla/virtuemart site main page or clicking on any of the non-virtuemart main menu links the requested query string is provided intact with no problems. However, when clicking on any link with the query string option set to com_virtuemart then additional (erroneous?) parameters are added to the query string as previously noted.

In addition the parameters added to the query string varies with the requested page. For example the link

http://localhost/joomla15/index.php?option=com_virtuemart&Itemid=54

gets transformed to

http://localhost/joomla15/index.php?option=com_virtuemart&Itemid=54&vmcchk=1&Itemid=53

while a link which includes in the query string something like &page=shop.browse&category_id=1
may have a different query suffix added. In fact, as a test, I temporarily altered the doCookieCheck() redirect in ps_session from

vmRedirect( $this->url( $mm_action_url . 'index.php?' . vmGet($_SERVER,'QUERY_STRING').'&vmcchk=1', true, false ));

to

vmRedirect( $this->url( $mm_action_url . 'index.php?' . vmGet($_SERVER,'QUERY_STRING').'&vmcchk=1&firestyleCartCheck=1' true, false ));

Sure enough  the $_GET array now contained an entry for firestyleCartCheck. The strange thing is that even after I deleted firestyleCartCheck from the redirect and went back to the original redirect command, the $_GET array continued to contain this erroneous entry whenever I made a new connection (and yes I restarted the browser before reconnecting). I made sure all the cache functions were off, checked the database to see if somehow an erroneous entry was present, and made sure that the browser was restarted on each test attempt but in the end found nothing that could explain this behavior. The erroneous query string modifications for firestyleCartCheck lasted about a week then went away(which is why I examined the various caches to see if that was the problem, also the erroneous firestyleCartCheck query string didn't show up immediately but a delay occurred before I saw it).


I admit I'm stumped. Clearly the query string is being altered by php || apache || an extension || ? prior to being provided to the joomla/virtuemart program but how I can't figure out. More importantly, why does this only happen when connecting to the virtuemart shop? Hope somebody out there has some ideas on the subject. As it now stands, I cannot trust virtuemart when cookies are disabled to produce a reasonable result (the problem appears to go away when cookies are enabled).

DDPaul

Configuration: joomla! 1.5.3(cache off , SEF off) ; virtuemart1.1.0 stable (23/04/2008) with ps_session modifications from revision 1439 source code; Firefox 2.0.0.14 (using both javascript enabled and disabled); Internet Explorer 7.0.6001.18000;  (Apache 2.2.8; MySQL 5.0.51a; PHP 5.2.5 installed on VISTA using XAMPP for Windows Version 1.6.6a ); both joomla! and virtuemart configured with sample data installed

Robyn

I also have the same problem: links to static contents show up as index.php?option=com_content&task=view&id=19&Itemid=65&Itemid=49

joomla 1.0.15 and vm 1.1.1