From: [EMAIL PROTECTED] Operating system: Any PHP version: 6CVS-2005-10-07 (CVS) PHP Bug Type: Feature/Change Request Bug description: parse_url() provide better error description on failure
Description: ------------ parse_url() may return FALSE if the url cannot be parsed but doesn't indicate why it failed. parse_url() internally calls php_url_parse_ex() which, from a quick look, has currently two cases it returns NULL (and thus parse_url() returns FALSE): 1) http://cvs.php.net/co.php/php-src/ext/standard/url.c?r=1.88#257 if (e-p > 5) { /* port cannot be longer then 5 characters */ [...] return NULL 2) http://cvs.php.net/co.php/php-src/ext/standard/url.c?r=1.88#274 /* check if we have a valid host, if we don't reject the string as url */ [...] return NULL; An error code or string should be available for functions calling php_url_parse_ex() so a message to the user can be forwarded why it failed. ps: the captcha is really really very unfriendly. This is my fifth try because all the time some of the character aren't even completely visible [cropped off] :-[ -- Edit bug report at http://bugs.php.net/?id=34775&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34775&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34775&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34775&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34775&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34775&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34775&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34775&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34775&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34775&r=support Expected behavior: http://bugs.php.net/fix.php?id=34775&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34775&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34775&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34775&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34775&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34775&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34775&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34775&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34775&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34775&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34775&r=mysqlcfg