PHP 4.0 Bug #1249 Updated: url_parse() is a bit too strict

From: Date: Thu, 22 Feb 2001 15:56:18 +0000
Subject: PHP 4.0 Bug #1249 Updated: url_parse() is a bit too strict
Groups: php.dev 
Request: Send a blank email to php-dev+get-47258@lists.php.net to get a copy of this message
ID: 1249 Updated by: stas Reported By: kundrat@general-it.sk Status: Open Bug Type: URL related Assigned To: Comments: I, personally, don't see why it has to parse such bogus URLs at all... Any arguments? Previous Comments: --------------------------------------------------------------------------- [2001-02-10 14:56:42] jimw@php.net refiled against 4.0. --------------------------------------------------------------------------- [2001-02-10 13:12:04] jimw@php.net this is a real bug, although relatively minor. --------------------------------------------------------------------------- [1999-03-20 18:26:16] kundrat@general-it.sk it is a minor glitch, though parse_url('?') returns path set, but query unset. After looking at url_parse() it seeems, that is would be more rational to test for subs[7].rm_so <= lentgh Equality case makes more sense for all the comparisons (maybe except for scheme where it wouldnt matter). Result of this would be, that any part that has its prefix present but value absent and is at the end of string would be set (though empty) Examples: '?' - query should be set, 'path#' fragment should be set, 'http://' hostname should be set to empty Another glitch is regexp for user:pass@host:port part. Now the regexp is ^(([^@:]+)(:([^@:]+))?@)?([^:@]+)(:([^:@]+))? while i suggest ^(([^@:]*)(:([^@:]*))?@)?([^:@]*)(:([^:@]*))? This is also in accordance with regex for the whole url. --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=1249&edit=2

« previous php.dev (#47258) next »