File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -238,15 +238,12 @@ ZEND_ATTRIBUTE_NONNULL static zend_result php_uri_parser_rfc3986_host_read(void
238238 if (uriparser_uri -> hostData .ip6 != NULL || uriparser_uri -> hostData .ipFuture .first != NULL ) {
239239 /* the textual representation of the host is always accessible in the .hostText field no matter what the host is */
240240 const size_t host_len = get_text_range_length (& uriparser_uri -> hostText );
241- zend_string * host_str = zend_string_alloc (host_len + 2 , false);
242-
243- char * out = ZSTR_VAL (host_str );
244-
245- * (out ++ ) = '[' ;
246- out = zend_mempcpy (out , uriparser_uri -> hostText .first , host_len );
247- * (out ++ ) = ']' ;
248- * out = '\0' ;
249-
241+
242+ zend_string * host_str = zend_string_concat3 (
243+ "[" , 1 ,
244+ uriparser_uri -> hostText .first , host_len ,
245+ "]" , 1
246+ );
250247 ZVAL_NEW_STR (retval , host_str );
251248 } else {
252249 ZVAL_STRINGL (retval , uriparser_uri -> hostText .first , get_text_range_length (& uriparser_uri -> hostText ));
You can’t perform that action at this time.
0 commit comments