use u_isalnum if available
authorMichael Wallner <mike@php.net>
Mon, 5 Mar 2018 10:52:49 +0000 (11:52 +0100)
committerMichael Wallner <mike@php.net>
Mon, 5 Mar 2018 10:52:49 +0000 (11:52 +0100)
src/php_http_url.c

index ad4f14cb87d222c47c227602dd7c418b74d23d10..71ca6e958a52301274b4a6cc9c090d696c0fae72 100644 (file)
@@ -19,6 +19,7 @@
 #      include <idn2.h>
 #endif
 #if PHP_HTTP_HAVE_LIBICU
+#      include <unicode/uchar.h>
 #      include <unicode/uidna.h>
 #endif
 #if PHP_HTTP_HAVE_LIBIDNKIT || PHP_HTTP_HAVE_LIBIDNKIT2
@@ -742,7 +743,11 @@ static inline size_t parse_mb(struct parse_state *state, parse_mb_what_t what, c
                        if (what == PARSE_HOSTINFO && (state->flags & PHP_HTTP_URL_PARSE_TOIDN)) {
                                /* idna */
                        } else if (state->flags & PHP_HTTP_URL_PARSE_MBUTF8) {
+#if PHP_HTTP_HAVE_LIBICU
+                               if (!u_isalnum(wchar)) {
+#else
                                if (!isualnum(wchar)) {
+#endif
                                        break;
                                }
 #if PHP_HTTP_HAVE_WCHAR