fix idna parser flags checking
authorMichael Wallner <mike@php.net>
Mon, 3 Oct 2016 13:34:22 +0000 (15:34 +0200)
committerMichael Wallner <mike@php.net>
Tue, 4 Oct 2016 08:25:11 +0000 (10:25 +0200)
src/php_http_url.c

index 7e325dcaa3fa5539c15fc7994020705b53c74b42..cead8c8ddc95c026d090d0e56391f269773eb3a3 100644 (file)
@@ -1189,9 +1189,9 @@ static ZEND_RESULT_CODE parse_widn_2003(struct parse_state *state)
 static ZEND_RESULT_CODE parse_idna(struct parse_state *state, size_t len)
 {
 #if PHP_HTTP_HAVE_IDNA2008
-       if ((state->flags & PHP_HTTP_URL_PARSE_TOIDN_2008)
+       if ((state->flags & PHP_HTTP_URL_PARSE_TOIDN_2008) == PHP_HTTP_URL_PARSE_TOIDN_2008
 #      if PHP_HTTP_HAVE_IDNA2003
-       || !(state->flags & PHP_HTTP_URL_PARSE_TOIDN_2003)
+       ||      (state->flags & PHP_HTTP_URL_PARSE_TOIDN_2003) != PHP_HTTP_URL_PARSE_TOIDN_2003
 #      endif
        ) {
 #if HAVE_UIDNA_NAMETOASCII_UTF8
@@ -1205,9 +1205,9 @@ static ZEND_RESULT_CODE parse_idna(struct parse_state *state, size_t len)
 #endif
 
 #if PHP_HTTP_HAVE_IDNA2003
-       if ((state->flags & PHP_HTTP_URL_PARSE_TOIDN_2003)
+       if ((state->flags & PHP_HTTP_URL_PARSE_TOIDN_2003) == PHP_HTTP_URL_PARSE_TOIDN_2003
 #      if PHP_HTTP_HAVE_IDNA2008
-       || !(state->flags & PHP_HTTP_URL_PARSE_TOIDN_2008)
+       ||      (state->flags & PHP_HTTP_URL_PARSE_TOIDN_2008) != PHP_HTTP_URL_PARSE_TOIDN_2008
 #endif
        ) {
 #if HAVE_UIDNA_IDNTOASCII