Skip to content

Commit

Permalink
Add RFC 3986 and WHATWG compliant URL parsing support
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Oct 12, 2024
1 parent e150b0b commit 02f5c6b
Show file tree
Hide file tree
Showing 128 changed files with 279,736 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ freebsd_task:
- 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
script:
- ./buildconf -f
- ./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
- ./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
- gmake -j2
- mkdir /etc/php.d
- gmake install
Expand Down
1 change: 1 addition & 0 deletions .github/actions/configure-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ runs:
--enable-pcntl \
--with-readline="$BREW_OPT"/readline \
--enable-mbstring \
--enable-uri \
--with-curl \
--with-gettext="$BREW_OPT"/gettext \
--enable-sockets \
Expand Down
1 change: 1 addition & 0 deletions .github/actions/configure-x32/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ runs:
--enable-pcntl \
--with-readline \
--enable-mbstring \
--enable-uri \
--with-curl \
--with-gettext \
--enable-sockets \
Expand Down
1 change: 1 addition & 0 deletions .github/actions/configure-x64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ runs:
--enable-pcntl \
--without-readline --with-libedit \
--enable-mbstring \
--enable-uri \
--with-curl \
--with-gettext \
--enable-sockets \
Expand Down
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@
- any-glob-to-any-file:
- ext/tokenizer/**/*

"Extension: uri":
- changed-files:
- any-glob-to-any-file:
- ext/uri/**/*

"Extension: xml":
- changed-files:
- any-glob-to-any-file:
Expand Down
6 changes: 6 additions & 0 deletions EXTENSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,12 @@ PRIMARY MAINTAINER: Andrei Zmievski <[email protected]> (2002 - 2002)
MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: uri
PRIMARY MAINTAINER Máté Kocsis <[email protected]> (2024 - 2024)
MAINTENANCE: Maintained
STATUS: Working
SINCE: 8.5.0
-------------------------------------------------------------------------------
EXTENSION: zip
PRIMARY MAINTAINER: Pierre-Alain Joye <[email protected]> (2006 - 2011)
Remi Collet <[email protected]> (2013-2020)
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ EMPTY_SWITCH_DEFAULT_CASE()
_(ZEND_STR_PORT, "port") \
_(ZEND_STR_USER, "user") \
_(ZEND_STR_PASS, "pass") \
_(ZEND_STR_PASSWORD, "password") \
_(ZEND_STR_PATH, "path") \
_(ZEND_STR_QUERY, "query") \
_(ZEND_STR_FRAGMENT, "fragment") \
Expand Down
10 changes: 9 additions & 1 deletion ext/dom/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if test "$PHP_DOM" != "no"; then
PHP_SETUP_LIBXML([DOM_SHARED_LIBADD], [
AC_DEFINE([HAVE_DOM], [1],
[Define to 1 if the PHP extension 'dom' is available.])
PHP_LEXBOR_CFLAGS="-I@ext_srcdir@/lexbor -DLEXBOR_STATIC"
PHP_LEXBOR_CFLAGS="-I@ext_srcdir@/lexbor -DLEXBOR_STATIC -Wno-uninitialized"
LEXBOR_DIR="lexbor/lexbor"
LEXBOR_SOURCES=m4_normalize(["
$LEXBOR_DIR/core/array_obj.c
Expand All @@ -22,6 +22,7 @@ if test "$PHP_DOM" != "no"; then
$LEXBOR_DIR/core/hash.c
$LEXBOR_DIR/core/mem.c
$LEXBOR_DIR/core/mraw.c
$LEXBOR_DIR/core/plog.c
$LEXBOR_DIR/core/print.c
$LEXBOR_DIR/core/serialize.c
$LEXBOR_DIR/core/shs.c
Expand Down Expand Up @@ -184,8 +185,12 @@ if test "$PHP_DOM" != "no"; then
$LEXBOR_DIR/html/tree/open_elements.c
$LEXBOR_DIR/ns/ns.c
$LEXBOR_DIR/ports/posix/lexbor/core/memory.c
$LEXBOR_DIR/punycode/punycode.c
$LEXBOR_DIR/selectors-adapted/selectors.c
$LEXBOR_DIR/tag/tag.c
$LEXBOR_DIR/unicode/idna.c
$LEXBOR_DIR/unicode/unicode.c
$LEXBOR_DIR/url/url.c
"])
PHP_NEW_EXTENSION([dom], m4_normalize([
attr.c
Expand Down Expand Up @@ -242,6 +247,9 @@ if test "$PHP_DOM" != "no"; then
$ext_builddir/$LEXBOR_DIR/ports/posix/lexbor/core
$ext_builddir/$LEXBOR_DIR/selectors-adapted
$ext_builddir/$LEXBOR_DIR/tag
$ext_builddir/$LEXBOR_DIR/punycode
$ext_builddir/$LEXBOR_DIR/unicode
$ext_builddir/$LEXBOR_DIR/url
])
PHP_SUBST([DOM_SHARED_LIBADD])
PHP_INSTALL_HEADERS([ext/dom], m4_normalize([
Expand Down
30 changes: 30 additions & 0 deletions ext/dom/lexbor/lexbor/punycode/base.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2023 Alexander Borisov
*
* Author: Alexander Borisov <[email protected]>
*/

#ifndef LEXBOR_PUNYCODE_BASE_H
#define LEXBOR_PUNYCODE_BASE_H

#ifdef __cplusplus
extern "C" {
#endif

#include "lexbor/core/base.h"


#define LXB_PUNYCODE_VERSION_MAJOR 1
#define LXB_PUNYCODE_VERSION_MINOR 0
#define LXB_PUNYCODE_VERSION_PATCH 0

#define LEXBOR_PUNYCODE_VERSION_STRING LEXBOR_STRINGIZE(LXB_PUNYCODE_VERSION_MAJOR) "." \
LEXBOR_STRINGIZE(LXB_PUNYCODE_VERSION_MINOR) "." \
LEXBOR_STRINGIZE(LXB_PUNYCODE_VERSION_PATCH)


#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* LEXBOR_PUNYCODE_BASE_H */
3 changes: 3 additions & 0 deletions ext/dom/lexbor/lexbor/punycode/config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set(DEPENDENCIES "core encoding")
set(DESCRIPTION "The module implemented by PUNYCODE specification.
Specification: https://www.rfc-editor.org/rfc/inline-errata/rfc3492.html")
Loading

0 comments on commit 02f5c6b

Please sign in to comment.