Skip to content

Commit b75cc5b

Browse files
committed
Some extension fixes
1 parent 7530dd9 commit b75cc5b

File tree

7 files changed

+60
-10
lines changed

7 files changed

+60
-10
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@
3131

3232
# Vendored libraries
3333
/ext/lexbor/lexbor linguist-vendored
34+
/ext/uri/uriparser linguist-vendored

README.REDIST.BINS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
19. xxHash (ext/hash/xxhash)
2020
20. Lexbor (ext/lexbor/lexbor) see ext/lexbor/LICENSE
2121
21. Portions of libcperciva (ext/hash/hash_sha_{ni,sse2}.c) see the header in the source file
22+
22. uriparser (ext/uri/uriparser) see ext/uri/uriparser/COPYING
2223

2324
3. pcre2lib (ext/pcre)
2425

codecov.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,10 @@ ignore:
77
- "ext/lexbor/lexbor/html"
88
- "ext/lexbor/lexbor/ns"
99
- "ext/lexbor/lexbor/ports"
10+
- "ext/lexbor/lexbor/punycode"
1011
- "ext/lexbor/lexbor/tag"
12+
- "ext/lexbor/lexbor/unicode"
13+
- "ext/lexbor/lexbor/url"
1114
- "ext/pcre/pcre2lib"
15+
- "ext/uri/uriparser/include"
16+
- "ext/uri/uriparser/src"

ext/uri/php_uri.c

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ zend_class_entry *whatwg_invalid_url_exception_ce;
4242
zend_class_entry *whatwg_url_validation_error_type_ce;
4343
zend_class_entry *whatwg_url_validation_error_ce;
4444

45+
static const zend_module_dep uri_deps[] = {
46+
ZEND_MOD_REQUIRED("lexbor")
47+
ZEND_MOD_END
48+
};
49+
4550
static zend_array uri_handlers;
4651

4752
static zend_object *uri_clone_obj_handler(zend_object *object);
@@ -1037,15 +1042,16 @@ PHP_RSHUTDOWN_FUNCTION(uri)
10371042
}
10381043

10391044
zend_module_entry uri_module_entry = {
1040-
STANDARD_MODULE_HEADER,
1041-
"uri", /* Extension name */
1045+
STANDARD_MODULE_HEADER_EX, NULL,
1046+
uri_deps,
1047+
"uri", /* Extension name */
10421048
NULL, /* zend_function_entry */
1043-
PHP_MINIT(uri), /* PHP_MINIT - Module initialization */
1044-
PHP_MSHUTDOWN(uri), /* PHP_MSHUTDOWN - Module shutdown */
1045-
PHP_RINIT(uri), /* PHP_RINIT - Request initialization */
1046-
PHP_RSHUTDOWN(uri), /* PHP_RSHUTDOWN - Request shutdown */
1047-
PHP_MINFO(uri), /* PHP_MINFO - Module info */
1048-
PHP_VERSION, /* Version */
1049+
PHP_MINIT(uri), /* PHP_MINIT - Module initialization */
1050+
PHP_MSHUTDOWN(uri), /* PHP_MSHUTDOWN - Module shutdown */
1051+
PHP_RINIT(uri), /* PHP_RINIT - Request initialization */
1052+
PHP_RSHUTDOWN(uri), /* PHP_RSHUTDOWN - Request shutdown */
1053+
PHP_MINFO(uri), /* PHP_MINFO - Module info */
1054+
PHP_VERSION, /* Version */
10491055
STANDARD_MODULE_PROPERTIES
10501056
};
10511057

ext/uri/php_uriparser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void uriparser_copy_text_range(UriTextRangeA *text_range, UriTextRangeA *
7575
}
7676
}
7777

78-
static UriUriA *uriparser_copy_uri(UriUriA *uriparser_uri)
78+
static UriUriA *uriparser_copy_uri(UriUriA *uriparser_uri) // TODO add to uriparser
7979
{
8080
UriUriA *new_uriparser_uri = emalloc(sizeof(UriUriA));
8181

@@ -574,7 +574,7 @@ static void *uriparser_reallocarray(UriMemoryManager *memory_manager, void *ptr,
574574
return erealloc(ptr, total_size);
575575
}
576576

577-
static void uriparser_free(UriMemoryManager *memory_manager, void * ptr)
577+
static void uriparser_free(UriMemoryManager *memory_manager, void *ptr)
578578
{
579579
efree(ptr);
580580
}

ext/uri/uriparser/COPYING

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
uriparser - RFC 3986 URI parsing library
2+
3+
Copyright (C) 2007, Weijia Song <songweijia@gmail.com>
4+
Copyright (C) 2007, Sebastian Pipping <sebastian@pipping.org>
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions
9+
are met:
10+
11+
1. Redistributions of source code must retain the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer.
14+
15+
2. Redistributions in binary form must reproduce the above
16+
copyright notice, this list of conditions and the following
17+
disclaimer in the documentation and/or other materials
18+
provided with the distribution.
19+
20+
3. Neither the name of the copyright holder nor the names of
21+
its contributors may be used to endorse or promote products
22+
derived from this software without specific prior written
23+
permission.
24+
25+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28+
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
29+
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
30+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34+
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
36+
OF THE POSSIBILITY OF SUCH DAMAGE.

scripts/dev/tidy.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
// Bundled libraries / files.
2525
'ext/date/lib/',
2626
'ext/lexbor/lexbor/',
27+
'ext/uri/uriparser/',
2728
'ext/fileinfo/data_file.c',
2829
'ext/fileinfo/libmagic/',
2930
'ext/gd/libgd/',

0 commit comments

Comments
 (0)