X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_url.c;h=4263aab6a068d7e961243a8608e751c3c4a7df1c;hp=23dec9f1968aa9b9964ed9339742dd92ecd9377a;hb=eacb6502617d4330cffe43ad57878b8902676397;hpb=37c5e00b8e827be61f286eba9c92c7adf3151b43 diff --git a/php_http_url.c b/php_http_url.c index 23dec9f..4263aab 100644 --- a/php_http_url.c +++ b/php_http_url.c @@ -384,7 +384,7 @@ static const char parse_xdigits[] = "0123456789ABCDEF"; static size_t parse_mb(php_http_url_t *url, parse_mb_what_t what, const char *ptr, const char *end, const char *begin, zend_bool silent) { size_t consumed = 0; - zend_bool idn = (what == PARSE_HOSTINFO) && (url->flags & PHP_HTTP_URL_PARSE_IDN); + zend_bool idn = (what == PARSE_HOSTINFO) && (url->flags & PHP_HTTP_URL_PARSE_TOIDN); if (url->flags & PHP_HTTP_URL_PARSE_MBUTF8) { consumed = parse_mb_utf8(url, ptr, end, idn); @@ -396,7 +396,7 @@ static size_t parse_mb(php_http_url_t *url, parse_mb_what_t what, const char *pt #endif if (consumed) { - if (!(url->flags & PHP_HTTP_URL_PARSE_PCTENC) || what == PARSE_HOSTINFO || what == PARSE_SCHEME) { + if (!(url->flags & PHP_HTTP_URL_PARSE_TOPCT) || what == PARSE_HOSTINFO || what == PARSE_SCHEME) { PHP_HTTP_DUFF(consumed, url->buffer[url->offset++] = *ptr++); } else { int i = 0; @@ -596,7 +596,7 @@ static STATUS parse_hostinfo(php_http_url_t *url, const char *ptr) } #ifdef PHP_HTTP_HAVE_IDN - if (url->flags & PHP_HTTP_URL_PARSE_IDN) { + if (url->flags & PHP_HTTP_URL_PARSE_TOIDN) { char *idn = NULL; int rv = -1; @@ -726,8 +726,8 @@ static const char *parse_query(php_http_url_t *url) const char *tmp = url->ptr + !!*url->ptr; TSRMLS_FETCH_FROM_CTX(url->ts); - /* is there actually a query to parse ? */ - if (!*url->ptr && *url->ptr != '?') { + /* is there actually a query to parse? */ + if (*url->ptr != '?') { return url->ptr; } @@ -790,8 +790,8 @@ static const char *parse_fragment(php_http_url_t *url) const char *tmp; TSRMLS_FETCH_FROM_CTX(url->ts); - /* is there actually a fragment to parse */ - if (!*url->ptr && *url->ptr != '#') { + /* is there actually a fragment to parse? */ + if (*url->ptr != '#') { return url->ptr; } @@ -1209,9 +1209,9 @@ PHP_MINIT_FUNCTION(http_url) #endif zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("PARSE_MBUTF8"), PHP_HTTP_URL_PARSE_MBUTF8 TSRMLS_CC); #ifdef PHP_HTTP_HAVE_IDN - zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("PARSE_IDN"), PHP_HTTP_URL_PARSE_IDN TSRMLS_CC); + zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("PARSE_TOIDN"), PHP_HTTP_URL_PARSE_TOIDN TSRMLS_CC); #endif - zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("PARSE_PCTENC"), PHP_HTTP_URL_PARSE_PCTENC TSRMLS_CC); + zend_declare_class_constant_long(php_http_url_class_entry, ZEND_STRL("PARSE_TOPCT"), PHP_HTTP_URL_PARSE_TOPCT TSRMLS_CC); return SUCCESS; }