@@ -188,7 +188,7 @@ alphadash = ([a-zA-Z] | "-");
188188#define YYLIMIT q
189189#define YYMARKER r
190190
191- static inline void append_modified_url (smart_str *url, smart_str *dest, smart_str *url_app, const char *separator, int type)
191+ static inline void append_modified_url (smart_str *url, smart_str *dest, smart_str *url_app, const zend_string *separator, int type)
192192{
193193 php_url *url_parts;
194194
@@ -271,7 +271,7 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
271271 smart_str_appendc (dest, ' ?' );
272272 if (url_parts->query ) {
273273 smart_str_appends (dest, ZSTR_VAL (url_parts->query ));
274- smart_str_appends (dest, separator);
274+ smart_str_append (dest, separator);
275275 smart_str_append_smart_str (dest, url_app);
276276 } else {
277277 smart_str_append_smart_str (dest, url_app);
@@ -757,7 +757,7 @@ static inline void php_url_scanner_add_var_impl(const char *name, size_t name_le
757757 }
758758
759759 if (url_state->url_app .s && ZSTR_LEN (url_state->url_app .s ) != 0 ) {
760- smart_str_appends (&url_state->url_app , PG (arg_separator).output );
760+ smart_str_append (&url_state->url_app , PG (arg_separator).output );
761761 }
762762
763763 if (encode) {
@@ -902,9 +902,9 @@ static inline zend_result php_url_scanner_reset_var_impl(zend_string *name, int
902902 /* Get end of url var */
903903 limit = ZSTR_VAL (url_state->url_app .s ) + ZSTR_LEN (url_state->url_app .s );
904904 end = start + ZSTR_LEN (url_app.s );
905- separator_len = strlen (PG (arg_separator).output );
905+ separator_len = ZSTR_LEN (PG (arg_separator).output );
906906 while (end < limit) {
907- if (!memcmp (end, PG (arg_separator).output , separator_len)) {
907+ if (!memcmp (end, ZSTR_VAL ( PG (arg_separator).output ) , separator_len)) {
908908 end += separator_len;
909909 sep_removed = 1 ;
910910 break ;
@@ -918,8 +918,8 @@ static inline zend_result php_url_scanner_reset_var_impl(zend_string *name, int
918918 }
919919 /* Check preceding separator */
920920 if (!sep_removed
921- && (size_t )(start - PG (arg_separator).output ) >= separator_len
922- && !memcmp (start - separator_len, PG (arg_separator).output , separator_len)) {
921+ && (size_t )(start - ZSTR_VAL ( PG (arg_separator).output ) ) >= separator_len
922+ && !memcmp (start - separator_len, ZSTR_VAL ( PG (arg_separator).output ) , separator_len)) {
923923 start -= separator_len;
924924 }
925925 /* Remove partially */
0 commit comments