Skip to content

Commit 7541b33

Browse files
committed
Fixes after rebase
1 parent 1525e64 commit 7541b33

File tree

5 files changed

+15
-31
lines changed

5 files changed

+15
-31
lines changed

‎ext/uri/config.w32

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
EXTENSION("uri", "php_lexbor.c php_uri.c php_uri_common.c", false /* never shared */, "/I ext/lexbor /I ext/uri/uriparser/include /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
1+
EXTENSION("uri", "php_lexbor.c php_uri.c php_uri_common.c php_uriparser.c", false /* never shared */, "/I ext/lexbor /I ext/uri/uriparser/include /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
22

33
AC_DEFINE("URI_ENABLE_ANSI", 1, "Define to 1 for enabling ANSI support of uriparser.")
44
AC_DEFINE("URI_NO_UNICODE", 1, "Define to 1 for disabling unicode support of uriparser.")
55
ADD_FLAG("CFLAGS_URI", "/D URI_STATIC_BUILD");
66

77
ADD_EXTENSION_DEP('uri', 'lexbor');
88
ADD_SOURCES("ext/uri/uriparser/src", "UriCommon.c UriCompare.c UriCopy.c UriEscape.c UriFile.c UriIp4.c UriIp4Base.c UriMemory.c UriNormalize.c UriNormalizeBase.c UriParse.c UriParseBase.c UriQuery.c UriRecompose.c UriResolve.c UriShorten.c", "uri");
9-
PHP_INSTALL_HEADERS("ext/uri", "php_lexbor.h php_uri.h php_uri_common.h uriparser/src uriparser/include");
9+
PHP_INSTALL_HEADERS("ext/uri", "php_lexbor.h php_uri.h php_uri_common.h php_uriparser.h uriparser/src uriparser/include");

‎ext/uri/php_uriparser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static zend_result uriparser_read_host(const uri_internal_t *internal_uri, uri_c
144144
ZEND_ASSERT(uriparser_uri != NULL);
145145

146146
if (uriparser_uri->hostText.first != NULL && uriparser_uri->hostText.afterLast != NULL && get_text_range_length(&uriparser_uri->hostText) > 0) {
147-
if (uriparser_uri->hostData.ip6 != NULL) {
147+
if (uriparser_uri->hostData.ip6 != NULL || uriparser_uri->hostData.ipFuture.first != NULL) {
148148
smart_str host_str = {0};
149149

150150
smart_str_appendc(&host_str, '[');
@@ -196,7 +196,7 @@ static zend_result uriparser_read_path(const uri_internal_t *internal_uri, uri_c
196196
const UriPathSegmentA *p;
197197
smart_str str = {0};
198198

199-
if (uriparser_uri->absolutePath || uriIsHostSetA(uriparser_uri)) {
199+
if (uriparser_uri->absolutePath || uriHasHostA(uriparser_uri)) {
200200
smart_str_appendc(&str, '/');
201201
}
202202

‎ext/uri/tests/047.phpt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ var_dump($uri->getHost());
1717
var_dump($uri->toRawString());
1818
var_dump($uri->toString());
1919

20+
$uri = new Uri\Rfc3986\Uri("//[v7.host]/source");
21+
var_dump($uri->getRawHost());
22+
var_dump($uri->getHost());
23+
var_dump($uri->toRawString());
24+
var_dump($uri->toString());
25+
2026
$url = new Uri\WhatWg\Url("https://192.168.0.1");
2127
var_dump($url->getAsciiHost());
2228
var_dump($url->toAsciiString());
@@ -39,6 +45,10 @@ string(41) "[2001:0db8:0001:0000:0000:0ab9:C0A8:0102]"
3945
string(41) "[2001:0db8:0001:0000:0000:0ab9:c0a8:0102]"
4046
string(49) "https://[2001:0db8:0001:0000:0000:0ab9:c0a8:0102]"
4147
string(49) "https://[2001:0db8:0001:0000:0000:0ab9:c0a8:0102]"
48+
string(9) "[v7.host]"
49+
string(9) "[v7.host]"
50+
string(18) "//[v7.host]/source"
51+
string(18) "//[v7.host]/source"
4252
string(11) "192.168.0.1"
4353
string(20) "https://192.168.0.1/"
4454
string(26) "[2001:db8:1::ab9:c0a8:102]"

‎ext/uri/uriparser/include/uriparser/Uri.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -654,33 +654,6 @@ URI_PUBLIC int URI_FUNC(ToString)(URI_CHAR * dest, const URI_TYPE(Uri) * uri,
654654
int maxChars, int * charsWritten);
655655

656656

657-
/**
658-
* Copies a %URI structure.
659-
*
660-
* @param destUri <b>OUT</b>: Output destination
661-
* @param sourceUri <b>IN</b>: %URI to copy
662-
* @param memory <b>IN</b>: Memory manager to use, NULL for default libc
663-
* @return Error code or 0 on success
664-
*
665-
* @since 0.9.8
666-
*/
667-
URI_PUBLIC int URI_FUNC(CopyUriMm)(URI_TYPE(Uri) * destUri,
668-
const URI_TYPE(Uri) * sourceUri, UriMemoryManager * memory);
669-
670-
671-
672-
/**
673-
* Copies a %URI structure.
674-
*
675-
* @param destUri <b>OUT</b>: Output destination
676-
* @param sourceUri <b>IN</b>: %URI to copy
677-
* @return Error code or 0 on success
678-
*
679-
* @since 0.9.8
680-
*/
681-
URI_PUBLIC int URI_FUNC(CopyUri)(URI_TYPE(Uri) * destUri, const URI_TYPE(Uri) * sourceUri);
682-
683-
684657

685658
/**
686659
* Copies a %URI structure.

‎ext/uri/uriparser/src/UriCommon.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070

7171
/* Used to point to from empty path segments.
7272
* X.first and X.afterLast must be the same non-NULL value then. */
73+
extern const URI_CHAR * const URI_FUNC(SafeToPointTo);
7374
extern const URI_CHAR * const URI_FUNC(ConstPwd);
7475
extern const URI_CHAR * const URI_FUNC(ConstParent);
7576

0 commit comments

Comments
 (0)