parse_url Warning Bug In Wordpress 2.9.2

Whilst setting up a new Wordpress install for a site development I found an odd little issue that would only occur in certain circumstances. My current development platform consists of an Apache server on which I create a virtual host for every development site I need. However, rather than setting a DNS entry for each address I just listen to diferent ports. In this particular instance I used the port 59419.

When the install was complete I was presented with the following error at the top of every admin page.

Warning: parse_url(http://10.0.0.1:594191?ver=20091217) [function.parse-url]: Unable to parse URL in \www\wp-includes\script-loader.php on line 542

For some reason Wordpress was adding a "1" to the end of the port number, which was causing the URL to throw a warning message when calling parse_url() as the port number can't be higher than about 65535 (depending on the system). This normally wouldn't cause an issue on most setups, but in this case it increased the port number just high enough to throw this error.

Although the warning is issued on line 542 of wp-includes\script-loader.php, I actually tracked the offending code down to line 438 in the same file. Here it is, along with the comment above it:

// Register "meta" stylesheet for admin colors. All colors-* style sheets should have the same version string.
$styles->add( 'colors', true, array(), $colors_version );

The true value is normally a CSS filename, but this one is needed to set some initial conditions for the rest of the admin styles. So when this is appended to the base path it is converted to 1, which is what normally happens when you echo a true boolean value in PHP. To solve this issue I just replaced this true value with a string consisting of a slash.

$styles->add( 'colors', '/', array(), $colors_version );

This has no effect on the functionality of this code. Removing this line completely will cause the admin area to lose all colours and images.

Although this is a very minor bug, it must have caused an issue on someone's system at some point in the past. So I put this fix here in case anyone else has had the same issue.

Share:

  • Add news feed
  • Bookmark this on Delicious

Comments

philipnorton42's picture

Hey! Glad to help :)

Hey! Glad to help :)

Woohoo! Thanks for the fix;

Woohoo! Thanks for the fix; Looks like someone did have the same problem :o)

thanks alot!

thanks alot!

Thanks man, you just saved me

Thanks man, you just saved me some time! :D

Thanks for this fix!

Thanks for this fix!
angiebrix's picture

Much Thanks

this is a great help for me. I am a newbie in Wordpress and I am glad there is a tutorial about it. thanks again

Cheers

I always find one or two problems with word press and I'm guessing when I update later this month that this will save me a few hours stress. Thanks.

Oh thank you, I am very

Oh thank you, I am very easily annoyed and you have made my day less evil, thank you thank you thank you!

Thanks you for your effort

really thank for help to remove the bug, thanks a lot

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2> <h3> <h4> <h5> <h6> <pre> <span> <p> <br />
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.