From: Zeev Suraski Date: Wed, 17 May 2000 15:41:32 +0000 (+0000) Subject: Only allow loading of extensions only during .ini file parsing X-Git-Tag: php-4.0.0~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=efb51322c171b2cc21c5b5cb79b07cb698e0d1ff;p=php Only allow loading of extensions only during .ini file parsing --- 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) {