@@ -512,8 +512,8 @@ int fpm_status_handle_request(void) /* {{{ */
512512 if (full_syntax ) {
513513 unsigned int i ;
514514 int first ;
515- zend_string * tmp_query_string ;
516- char * query_string ;
515+ zend_string * tmp_query_string , * tmp_request_uri_string ;
516+ char * query_string , * request_uri_string ;
517517 struct timeval duration , now ;
518518 float cpu ;
519519
@@ -538,13 +538,36 @@ int fpm_status_handle_request(void) /* {{{ */
538538 }
539539 }
540540
541+ request_uri_string = NULL ;
542+ tmp_request_uri_string = NULL ;
543+ if (proc -> request_uri [0 ] != '\0' ) {
544+ if (encode_html ) {
545+ tmp_request_uri_string = php_escape_html_entities_ex (
546+ (const unsigned char * ) proc -> request_uri ,
547+ strlen (proc -> request_uri ), 1 , ENT_DISALLOWED | ENT_HTML_DOC_XML1 | ENT_COMPAT ,
548+ NULL , /* double_encode */ 1 , /* quiet */ 0 );
549+ request_uri_string = ZSTR_VAL (tmp_request_uri_string );
550+ } else if (encode_json ) {
551+ tmp_request_uri_string = php_json_encode_string (proc -> request_uri ,
552+ strlen (proc -> request_uri ), PHP_JSON_INVALID_UTF8_IGNORE );
553+ request_uri_string = ZSTR_VAL (tmp_request_uri_string );
554+ /* remove quotes around the string */
555+ if (ZSTR_LEN (tmp_request_uri_string ) >= 2 ) {
556+ request_uri_string [ZSTR_LEN (tmp_request_uri_string ) - 1 ] = '\0' ;
557+ ++ request_uri_string ;
558+ }
559+ } else {
560+ request_uri_string = proc -> request_uri ;
561+ }
562+ }
563+
541564 query_string = NULL ;
542565 tmp_query_string = NULL ;
543566 if (proc -> query_string [0 ] != '\0' ) {
544567 if (encode_html ) {
545568 tmp_query_string = php_escape_html_entities_ex (
546569 (const unsigned char * ) proc -> query_string ,
547- strlen (proc -> query_string ), 1 , ENT_HTML_IGNORE_ERRORS & ENT_COMPAT ,
570+ strlen (proc -> query_string ), 1 , ENT_DISALLOWED | ENT_HTML_DOC_XML1 | ENT_COMPAT ,
548571 NULL , /* double_encode */ 1 , /* quiet */ 0 );
549572 } else if (encode_json ) {
550573 tmp_query_string = php_json_encode_string (proc -> query_string ,
@@ -583,7 +606,7 @@ int fpm_status_handle_request(void) /* {{{ */
583606 proc -> requests ,
584607 (unsigned long ) (duration .tv_sec * 1000000UL + duration .tv_usec ),
585608 proc -> request_method [0 ] != '\0' ? proc -> request_method : "-" ,
586- proc -> request_uri [ 0 ] != '\0' ? proc -> request_uri : "-" ,
609+ request_uri_string ? request_uri_string : "-" ,
587610 query_string ? "?" : "" ,
588611 query_string ? query_string : "" ,
589612 proc -> content_length ,
@@ -594,6 +617,9 @@ int fpm_status_handle_request(void) /* {{{ */
594617 PUTS (buffer );
595618 efree (buffer );
596619
620+ if (tmp_request_uri_string ) {
621+ zend_string_free (tmp_request_uri_string );
622+ }
597623 if (tmp_query_string ) {
598624 zend_string_free (tmp_query_string );
599625 }
0 commit comments