com php-src: Merge branch 'PHP-5.6': NEWS ext/standard/url.c

From: Date: Fri, 06 Mar 2015 12:59:52 +0000
Subject: com php-src: Merge branch 'PHP-5.6': NEWS ext/standard/url.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85289@lists.php.net to get a copy of this message
Commit: 1236a30746119c3c99754c6c639a134d0e6318d6 Author: Tjerk Meesters <datibbaw@php.net> Fri, 6 Mar 2015 20:59:52 +0800 Parents: 4bc7ee2eb776b05c8794c2c3abb5f995d4ddc8e7 469b5a9584b1647fdccb37b663dd076ba991d764 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1236a30746119c3c99754c6c639a134d0e6318d6 Log: Merge branch 'PHP-5.6' * PHP-5.6: Fixed bug #68917 (parse_url fails on some partial urls) Update test to run locally instead of remotely Bugs: https://bugs.php.net/68917 Changed paths: MM NEWS MM ext/standard/url.c Diff: diff --cc NEWS index 81aa649,d248f86..d7ac6bf --- a/NEWS +++ b/NEWS @@@ -20,6 -26,12 +20,7 @@@ . Fixed bug #68166 (Exception with invalid character causes segv). (Rasmus) . Fixed bug #69141 (Missing arguments in reflection info for some builtin functions). (kostyantyn dot lysyy at oracle dot com) - -- CGI: - . Fixed bug #69015 (php-cgi's getopt does not see $argv). (Laruence) - -- CLI: - . Fixed bug #67741 (auto_prepend_file messes up __LINE__). (Reeze Xia) ++ . Fixed bug #68917 (parse_url fails on some partial urls). (Wei Dai) - cURL: . Fixed bug #69088 (PHP_MINIT_FUNCTION does not fully initialize cURL on diff --cc ext/standard/url.c index deb1450,2f56d31..b2ffa37 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@@ -186,22 -186,25 +186,25 @@@ PHPAPI php_url *php_url_parse_ex(char c } if (pp - p > 0 && pp - p < 6 && (*pp == '/' || *pp == '\0')) { - long port; + zend_long port; memcpy(port_buf, p, (pp - p)); port_buf[pp - p] = '\0'; - port = strtol(port_buf, NULL, 10); + port = ZEND_STRTOL(port_buf, NULL, 10); if (port > 0 && port <= 65535) { ret->port = (unsigned short) port; + if (*s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ + s += 2; + } } else { - STR_FREE(ret->scheme); + if (ret->scheme) efree(ret->scheme); efree(ret); return NULL; } } else if (p == pp && *pp == '\0') { - STR_FREE(ret->scheme); + if (ret->scheme) efree(ret->scheme); efree(ret); return NULL; - } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ + } else if (*s == '/' && *(s + 1) == '/') { /* relative-scheme URL */ s += 2; } else { goto just_path;

« previous php.cvs (#85289) next »