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);
#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;
}
#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;
#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;
}
/* parse utf8 multibyte sequences */
#define PHP_HTTP_URL_PARSE_MBUTF8 0x002
/* convert multibyte hostnames to IDNA */
-#define PHP_HTTP_URL_PARSE_IDN 0x010
+#define PHP_HTTP_URL_PARSE_TOIDN 0x010
/* percent encode multibyte sequences in userinfo, path, query and fragment */
-#define PHP_HTTP_URL_PARSE_PCTENC 0x020
+#define PHP_HTTP_URL_PARSE_TOPCT 0x020
typedef struct php_http_url {
/* compatible to php_url, but do not use php_url_free() */
<?php
include "skipif.inc";
if (!defined("http\\Url::PARSE_MBLOC") or
- !defined("http\\Url::PARSE_IDN") or
+ !defined("http\\Url::PARSE_TOIDN") or
!stristr(setlocale(LC_CTYPE, NULL), ".utf")) {
- die("skip need http\\Url::PARSE_MBLOC|http\\Url::PARSE_IDN support and LC_CTYPE=*.UTF-8");
+ die("skip need http\\Url::PARSE_MBLOC|http\\Url::PARSE_TOIDN support and LC_CTYPE=*.UTF-8");
}
?>
--FILE--
foreach ($urls as $url) {
printf("\n%s\n", $url);
- var_dump(http\Url::parse($url, http\Url::PARSE_MBLOC|http\Url::PARSE_IDN));
+ var_dump(http\Url::parse($url, http\Url::PARSE_MBLOC|http\Url::PARSE_TOIDN));
}
?>
DONE
--SKIPIF--
<?php
include "skipif.inc";
-if (!defined("http\\Url::PARSE_IDN")) {
- die("skip need http\\Url::PARSE_IDN support");
+if (!defined("http\\Url::PARSE_TOIDN")) {
+ die("skip need http\\Url::PARSE_TOIDN support");
}
?>
--FILE--
foreach ($urls as $url) {
printf("\n%s\n", $url);
- var_dump(http\Url::parse($url, http\Url::PARSE_MBUTF8|http\Url::PARSE_IDN));
+ var_dump(http\Url::parse($url, http\Url::PARSE_MBUTF8|http\Url::PARSE_TOIDN));
}
?>
DONE