We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f3f561 commit 7929820Copy full SHA for 7929820
1 file changed
ext/uri/uri_parser_rfc3986.c
@@ -760,11 +760,10 @@ ZEND_ATTRIBUTE_NONNULL zend_result php_uri_parser_rfc3986_validate_host(const ze
760
761
ZEND_ATTRIBUTE_NONNULL zend_result php_uri_parser_rfc3986_validate_port(const zend_long port)
762
{
763
- zend_string *tmp = zend_long_to_str(port);
764
- const char *p = ZSTR_VAL(tmp);
765
- const size_t len = ZSTR_LEN(tmp);
766
- const bool well_formed = uriIsWellFormedPortA(p, p + len);
767
- zend_string_release(tmp);
+ char buf[MAX_LENGTH_OF_LONG + 1];
+ const char *res = zend_print_long_to_buf(buf + sizeof(buf) - 1, port);
+
+ const bool well_formed = uriIsWellFormedPortA(res, res + strlen(res));
768
769
return php_uri_parser_rfc3986_validate_component_result(well_formed, "port");
770
}
0 commit comments