From efb51322c171b2cc21c5b5cb79b07cb698e0d1ff Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Wed, 17 May 2000 15:41:32 +0000 Subject: [PATCH] Only allow loading of extensions only during .ini file parsing --- main/configuration-parser.y | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/main/configuration-parser.y b/main/configuration-parser.y index e371ce96c6..ccf8fb793c 100644 --- a/main/configuration-parser.y +++ b/main/configuration-parser.y @@ -466,36 +466,46 @@ statement: } | TC_STRING { free($1.value.str.val); } | EXTENSION '=' cfg_string { - zval dummy; + if (parsing_mode==PARSING_MODE_CFG) { + zval dummy; + #if DEBUG_CFG_PARSER - printf("Loading '%s'\n",$3.value.str.val); + printf("Loading '%s'\n",$3.value.str.val); #endif - - php_dl(&$3,MODULE_PERSISTENT,&dummy); + php_dl(&$3,MODULE_PERSISTENT,&dummy); + } } | T_ZEND_EXTENSION '=' cfg_string { + if (parsing_mode==PARSING_MODE_CFG) { #if !defined(ZTS) && !ZEND_DEBUG - zend_load_extension($3.value.str.val); + zend_load_extension($3.value.str.val); #endif - free($3.value.str.val); + free($3.value.str.val); + } } | T_ZEND_EXTENSION_TS '=' cfg_string { + if (parsing_mode==PARSING_MODE_CFG) { #if defined(ZTS) && !ZEND_DEBUG - zend_load_extension($3.value.str.val); + zend_load_extension($3.value.str.val); #endif - free($3.value.str.val); + free($3.value.str.val); + } } | T_ZEND_EXTENSION_DEBUG '=' cfg_string { #if !defined(ZTS) && ZEND_DEBUG - zend_load_extension($3.value.str.val); + if (parsing_mode==PARSING_MODE_CFG) { + zend_load_extension($3.value.str.val); #endif - free($3.value.str.val); + free($3.value.str.val); + } } | T_ZEND_EXTENSION_DEBUG_TS '=' cfg_string { + if (parsing_mode==PARSING_MODE_CFG) { #if defined(ZTS) && ZEND_DEBUG - zend_load_extension($3.value.str.val); + zend_load_extension($3.value.str.val); #endif - free($3.value.str.val); + free($3.value.str.val); + } } | SECTION { if (parsing_mode==PARSING_MODE_BROWSCAP) { -- 2.50.1