]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorTjerk Meesters <datibbaw@php.net>
Fri, 6 Mar 2015 12:59:52 +0000 (20:59 +0800)
committerTjerk Meesters <datibbaw@php.net>
Fri, 6 Mar 2015 12:59:52 +0000 (20:59 +0800)
* PHP-5.6:
  Fixed bug #68917 (parse_url fails on some partial urls)
  Update test to run locally instead of remotely

1  2 
NEWS
ext/standard/url.c

diff --cc NEWS
index 81aa649452e9884b448e8c493b5c8558a68ae2fe,d248f86483f6c94b55b3688de537e908b2c5aac8..d7ac6bfab265eb11733d040391f7ee2622d58a68
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
    . 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
index deb1450ad2482f32d569fb3293a0fa4f215d4d99,2f56d3186d45767f6a46ecd4f7a269898bb4e411..b2ffa3750e46ac0f9dc24dc9c588b6722b139615
@@@ -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;