File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1931,22 +1931,18 @@ PHP_FUNCTION(php_strip_whitespace)
1931
1931
/* {{{ Syntax highlight a string or optionally return it */
1932
1932
PHP_FUNCTION (highlight_string )
1933
1933
{
1934
- zval * expr ;
1934
+ zend_string * str ;
1935
1935
zend_syntax_highlighter_ini syntax_highlighter_ini ;
1936
1936
char * hicompiled_string_description ;
1937
1937
zend_bool i = 0 ;
1938
1938
int old_error_reporting = EG (error_reporting );
1939
1939
1940
1940
ZEND_PARSE_PARAMETERS_START (1 , 2 )
1941
- Z_PARAM_ZVAL ( expr )
1941
+ Z_PARAM_STR ( str )
1942
1942
Z_PARAM_OPTIONAL
1943
1943
Z_PARAM_BOOL (i )
1944
1944
ZEND_PARSE_PARAMETERS_END ();
1945
1945
1946
- if (!try_convert_to_string (expr )) {
1947
- RETURN_THROWS ();
1948
- }
1949
-
1950
1946
if (i ) {
1951
1947
php_output_start_default ();
1952
1948
}
@@ -1957,8 +1953,12 @@ PHP_FUNCTION(highlight_string)
1957
1953
1958
1954
hicompiled_string_description = zend_make_compiled_string_description ("highlighted code" );
1959
1955
1960
- highlight_string (expr , & syntax_highlighter_ini , hicompiled_string_description );
1956
+ // TODO: Accept zend_string in highlight_string API.
1957
+ zval str_zv ;
1958
+ ZVAL_STR_COPY (& str_zv , str );
1959
+ highlight_string (& str_zv , & syntax_highlighter_ini , hicompiled_string_description );
1961
1960
efree (hicompiled_string_description );
1961
+ zval_ptr_dtor (& str_zv );
1962
1962
1963
1963
EG (error_reporting ) = old_error_reporting ;
1964
1964
You can’t perform that action at this time.
0 commit comments