The Derek Gendron weblog : 0eth0s0

ethos: The disposition, character, or fundamental values peculiar to a specific person, people, culture, or movement.

Server logs show cubecart 4 error Warning: parse_url(/index.php? Unable to parse url

If you are seeing something like this in your Cubecart or server logs:Cubecart ecommerce shopping cart

[Mon Mar 03 20:27:46 2008] [error] [client 69.47.58.156] PHP Warning: parse_url(/index.php?main_page=http://joioiskioeriyyskwkdwjsdfewis.land.ru/.html/body?) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse url in /var/www/vhosts/YOURSITE.com/httpdocs/includes/sslSwitch.inc.php on line 36

Here is a fix to suppress the error:

edit file includes\sslSwitch.inc.php
FIND: $url_elements = parse_url($_SERVER['REQUEST_URI']);
REPLACE WITH: $url_elements = @parse_url($_SERVER['REQUEST_URI']);
(fixed in MP not in KN)

According to cubecart support staff:

That will indeed suppress the warning, however it is not a bug…at least not in CubeCart. It is a PHP4 bug (we are using php 5.x!), but it doesn’t cause any problems, just the warning. Thanks!

Remember, ALWAYS create a backup prior to doing ANY modifications to files.

Hope this helps someone, if I can ever help with Cubecarts or mods or PHP email me by clicking Contact button at top of page.

– Derek