diff options
Diffstat (limited to 'ext/standard/dl.c')
-rw-r--r-- | ext/standard/dl.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 9bf3e443c9..012592381b 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -97,9 +97,9 @@ PHPAPI PHP_FUNCTION(dl) #define USING_ZTS 0 #endif -/* {{{ php_dl +/* {{{ php_load_extension */ -PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) /* {{{ */ +PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) { void *handle; char *libpath; @@ -171,6 +171,11 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) } if (!get_module) { + if (DL_FETCH_SYMBOL(handle, "zend_extension_entry") || DL_FETCH_SYMBOL(handle, "_zend_extension_entry")) { + DL_UNLOAD(handle); + php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (appears to be a Zend Extension, try loading using zend_extension=%s from php.ini)", filename); + return FAILURE; + } DL_UNLOAD(handle); php_error_docref(NULL TSRMLS_CC, error_type, "Invalid library (maybe not a PHP library) '%s'", filename); return FAILURE; |