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

From: Date: Sat, 20 Mar 1999 23:26:16 +0000
Subject: Bug #1249: url_parse() is a bit too strict
Groups: php.dev 
Request: Send a blank email to php-dev+get-4694@lists.php.net to get a copy of this message
From: kundrat@general-it.sk Operating system: linux 2.2.1 glibc 2.0.7 PHP version: 3.0.7 PHP Bug Type: Feature/Change Request Bug description: url_parse() is a bit too strict 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. -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#4694) next »