Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2008 at 10:37 UTC
Updated:
29 Aug 2008 at 08:12 UTC
Jump to comment: Most recent file
Comments
Comment #1
dries commentedDoes parse_url() return FALSE in that case? If so, I'd check for FALSE. If not, the patch looks good.
Comment #2
aron novakResult:
Comment #3
c960657 commentedI suggest also checking whether $uri['host'] is set. The code further down assumes it is.
Comment #4
dries commentedc960657 is right.
Comment #5
mustafau commentedI have updated the patch.
Comment #6
dries commentedI've committed this to CVS HEAD and DRUPAL-6. Wouldn't hurt to have some tests for this. Marking it as 'code needs work'.
Comment #7
mustafau commentedIt seems that when host is not set parse_url returns FALSE so we never get a "missing host" error. Instead of checking for $uri['host'] we should check for FALSE.
A test case is also attached.
Comment #8
dries commentedTested, reviewed and committed to CVS HEAD. I've also backported this to DRUPAL-6. Thanks for the tests! Let's write some more.
Comment #9
damien tournoud commentedWhat is the rationale of moving common.test out of includes/tests and to modules/simpletest/tests? Not that I don't support this, but this not seems like the good issue to do that.
Comment #10
mustafau commentedTests in includes/tests are no longer supported by Simpletest. See this commit: http://drupal.org/cvs?commit=132616
I had to move common.test because there was no other way to make my tests recognized by Simpletest.
Comment #11
catchI get an exception on the drupal_http_request() test:
parse_url(http:///path) [function.parse-url]: Unable to parse URL Warning common.inc 437
Comment #12
c960657 commentedPerhaps valid_url() could be utilized for validating the URL.
That method also has its flaws (see e.g. #124492: valid_url() does not support all valid URL characters or #247880: valid_url needs to support more characters), but it is probably better to fix them rather than having two different ways of validating URLs.
Comment #13
mustafau commentedThe exception is unavoidable. I have put an @ operator to that particular function call to suppress the exception. See attached patch.
Comment #14
catchPatch works good, doesn't affect the test. RTBC.
Comment #15
boombatower commentedWouldn't it make more sense to but the @ operator on in the actual function instead of in the test?
I have a patch I created before becoming aware of this thread which also has an updated test.
#295564: drupal_http_request triggers error in addition to returning it & test cleanup
Comment #16
dries commentedLooks like we are still discussing this.
Comment #17
catchBoombatower's patch looks good, and an extra test can't hurt, so back to fixed and we can deal with it in the other issue.
Comment #18
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.