mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
This appears to be the correct fix to me.
@ Fix memory leak in x-httpd-source mode (Jason Greene)
This commit is contained in:
parent
beb42300e1
commit
c3026223f7
1 changed files with 9 additions and 9 deletions
|
@ -69,23 +69,23 @@ int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC
|
||||||
/* sending a file handle to another dll is not working
|
/* sending a file handle to another dll is not working
|
||||||
// so let zend open it.
|
// so let zend open it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (display_source_mode) {
|
||||||
|
zend_syntax_highlighter_ini syntax_highlighter_ini;
|
||||||
|
|
||||||
|
php_get_highlight_struct(&syntax_highlighter_ini);
|
||||||
|
if (highlight_file(SG(request_info).path_translated,&syntax_highlighter_ini)){
|
||||||
|
return OK;
|
||||||
|
} else {
|
||||||
|
return NOT_FOUND;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
file_handle.type = ZEND_HANDLE_FILENAME;
|
file_handle.type = ZEND_HANDLE_FILENAME;
|
||||||
file_handle.handle.fd = 0;
|
file_handle.handle.fd = 0;
|
||||||
file_handle.filename = SG(request_info).path_translated;
|
file_handle.filename = SG(request_info).path_translated;
|
||||||
file_handle.opened_path = NULL;
|
file_handle.opened_path = NULL;
|
||||||
file_handle.free_filename = 0;
|
file_handle.free_filename = 0;
|
||||||
|
|
||||||
if (display_source_mode) {
|
|
||||||
zend_syntax_highlighter_ini syntax_highlighter_ini;
|
|
||||||
|
|
||||||
if (open_file_for_scanning(&file_handle CLS_CC)==SUCCESS) {
|
|
||||||
php_get_highlight_struct(&syntax_highlighter_ini);
|
|
||||||
zend_highlight(&syntax_highlighter_ini);
|
|
||||||
return OK;
|
|
||||||
} else {
|
|
||||||
return NOT_FOUND;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
(void) php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
|
(void) php_execute_script(&file_handle CLS_CC ELS_CC PLS_CC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue