Skip to content

Commit dcb0299

Browse files
committed
Add RFC 3986 and WHATWG compliant URL parsing support
1 parent 0f2f7c6 commit dcb0299

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+277643
-5
lines changed

Diff for: .cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ freebsd_task:
1414
- pkg install -y autoconf bison gmake re2c icu libiconv png freetype2 enchant2 bzip2 t1lib gmp tidyp libsodium libzip libxml2 libxslt openssl oniguruma pkgconf webp libavif
1515
script:
1616
- ./buildconf -f
17-
- ./configure --prefix=/usr/local --enable-debug --enable-option-checking=fatal --enable-fpm --with-pdo-sqlite --without-pear --with-bz2 --with-avif --with-jpeg --with-webp --with-freetype --enable-gd --enable-exif --with-zip --with-zlib --enable-soap --enable-xmlreader --with-xsl --with-libxml --enable-shmop --enable-pcntl --enable-mbstring --with-curl --enable-sockets --with-openssl --with-iconv=/usr/local --enable-bcmath --enable-calendar --enable-ftp --with-ffi --enable-zend-test --enable-dl-test=shared --enable-intl --with-mhash --with-sodium --enable-werror --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
17+
- ./configure --prefix=/usr/local --enable-debug --enable-option-checking=fatal --enable-fpm --with-pdo-sqlite --without-pear --with-bz2 --with-avif --with-jpeg --with-webp --with-freetype --enable-gd --enable-exif --with-zip --with-zlib --enable-soap --enable-xmlreader --with-xsl --with-libxml --enable-shmop --enable-pcntl --enable-mbstring --enable-uri --with-curl --enable-sockets --with-openssl --with-iconv=/usr/local --enable-bcmath --enable-calendar --enable-ftp --with-ffi --enable-zend-test --enable-dl-test=shared --enable-intl --with-mhash --with-sodium --enable-werror --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d
1818
- gmake -j2
1919
- mkdir /etc/php.d
2020
- gmake install

Diff for: .github/actions/configure-macos/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ runs:
4747
--enable-pcntl \
4848
--with-readline="$BREW_OPT"/readline \
4949
--enable-mbstring \
50+
--enable-uri \
5051
--with-curl \
5152
--with-gettext="$BREW_OPT"/gettext \
5253
--enable-sockets \

Diff for: .github/actions/configure-x64/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ runs:
4343
--enable-pcntl \
4444
--with-readline \
4545
--enable-mbstring \
46+
--enable-uri \
4647
--with-curl \
4748
--with-gettext \
4849
--enable-sockets \

Diff for: .github/labeler.yml

+5
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@
320320
- any-glob-to-any-file:
321321
- ext/tokenizer/**/*
322322

323+
"Extension: uri":
324+
- changed-files:
325+
- any-glob-to-any-file:
326+
- ext/uri/**/*
327+
323328
"Extension: xml":
324329
- changed-files:
325330
- any-glob-to-any-file:

Diff for: EXTENSIONS

+6
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,12 @@ PRIMARY MAINTAINER: Andrei Zmievski <[email protected]> (2002 - 2002)
493493
MAINTENANCE: Maintained
494494
STATUS: Working
495495
-------------------------------------------------------------------------------
496+
EXTENSION: uri
497+
PRIMARY MAINTAINER Máté Kocsis <[email protected]> (2024 - 2024)
498+
MAINTENANCE: Maintained
499+
STATUS: Working
500+
SINCE: 8.5.0
501+
-------------------------------------------------------------------------------
496502
EXTENSION: zip
497503
PRIMARY MAINTAINER: Pierre-Alain Joye <[email protected]> (2006 - 2011)
498504
Remi Collet <[email protected]> (2013-2020)

Diff for: Zend/zend_string.h

+1
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ EMPTY_SWITCH_DEFAULT_CASE()
595595
_(ZEND_STR_PORT, "port") \
596596
_(ZEND_STR_USER, "user") \
597597
_(ZEND_STR_PASS, "pass") \
598+
_(ZEND_STR_PASSWORD, "password") \
598599
_(ZEND_STR_PATH, "path") \
599600
_(ZEND_STR_QUERY, "query") \
600601
_(ZEND_STR_FRAGMENT, "fragment") \

Diff for: ext/dom/config.m4

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if test "$PHP_DOM" != "no"; then
1212

1313
PHP_SETUP_LIBXML([DOM_SHARED_LIBADD], [
1414
AC_DEFINE([HAVE_DOM], [1], [Define to 1 if dom extension is available.])
15-
PHP_LEXBOR_CFLAGS="-I@ext_srcdir@/lexbor -DLEXBOR_STATIC"
15+
PHP_LEXBOR_CFLAGS="-I@ext_srcdir@/lexbor -DLEXBOR_STATIC -Wno-uninitialized"
1616
LEXBOR_DIR="lexbor/lexbor"
1717
LEXBOR_SOURCES=m4_normalize(["
1818
$LEXBOR_DIR/core/array_obj.c
@@ -26,6 +26,7 @@ if test "$PHP_DOM" != "no"; then
2626
$LEXBOR_DIR/core/hash.c
2727
$LEXBOR_DIR/core/mem.c
2828
$LEXBOR_DIR/core/mraw.c
29+
$LEXBOR_DIR/core/plog.c
2930
$LEXBOR_DIR/core/print.c
3031
$LEXBOR_DIR/core/serialize.c
3132
$LEXBOR_DIR/core/shs.c
@@ -188,8 +189,12 @@ if test "$PHP_DOM" != "no"; then
188189
$LEXBOR_DIR/html/tree/open_elements.c
189190
$LEXBOR_DIR/ns/ns.c
190191
$LEXBOR_DIR/ports/posix/lexbor/core/memory.c
192+
$LEXBOR_DIR/punycode/punycode.c
191193
$LEXBOR_DIR/selectors-adapted/selectors.c
192194
$LEXBOR_DIR/tag/tag.c
195+
$LEXBOR_DIR/unicode/idna.c
196+
$LEXBOR_DIR/unicode/unicode.c
197+
$LEXBOR_DIR/url/url.c
193198
"])
194199
PHP_NEW_EXTENSION([dom], m4_normalize([
195200
attr.c
@@ -246,6 +251,9 @@ if test "$PHP_DOM" != "no"; then
246251
$ext_builddir/$LEXBOR_DIR/ports/posix/lexbor/core
247252
$ext_builddir/$LEXBOR_DIR/selectors-adapted
248253
$ext_builddir/$LEXBOR_DIR/tag
254+
$ext_builddir/$LEXBOR_DIR/punycode
255+
$ext_builddir/$LEXBOR_DIR/unicode
256+
$ext_builddir/$LEXBOR_DIR/url
249257
]))
250258
PHP_SUBST([DOM_SHARED_LIBADD])
251259
PHP_INSTALL_HEADERS([ext/dom], m4_normalize([

Diff for: ext/dom/lexbor/lexbor/punycode/base.h

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (C) 2023 Alexander Borisov
3+
*
4+
* Author: Alexander Borisov <[email protected]>
5+
*/
6+
7+
#ifndef LEXBOR_PUNYCODE_BASE_H
8+
#define LEXBOR_PUNYCODE_BASE_H
9+
10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
14+
#include "lexbor/core/base.h"
15+
16+
17+
#define LXB_PUNYCODE_VERSION_MAJOR 1
18+
#define LXB_PUNYCODE_VERSION_MINOR 0
19+
#define LXB_PUNYCODE_VERSION_PATCH 0
20+
21+
#define LEXBOR_PUNYCODE_VERSION_STRING LEXBOR_STRINGIZE(LXB_PUNYCODE_VERSION_MAJOR) "." \
22+
LEXBOR_STRINGIZE(LXB_PUNYCODE_VERSION_MINOR) "." \
23+
LEXBOR_STRINGIZE(LXB_PUNYCODE_VERSION_PATCH)
24+
25+
26+
#ifdef __cplusplus
27+
} /* extern "C" */
28+
#endif
29+
30+
#endif /* LEXBOR_PUNYCODE_BASE_H */

Diff for: ext/dom/lexbor/lexbor/punycode/config.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set(DEPENDENCIES "core encoding")
2+
set(DESCRIPTION "The module implemented by PUNYCODE specification.
3+
Specification: https://www.rfc-editor.org/rfc/inline-errata/rfc3492.html")

0 commit comments

Comments
 (0)