summaryrefslogtreecommitdiff
path: root/main/SAPI.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-04-25 08:40:07 +0000
committerDmitry Stogov <dmitry@php.net>2007-04-25 08:40:07 +0000
commit8464abe22ebba93ecd60845e6d683c3c24a61a15 (patch)
treecaa8ea6240e1135aa48ef3e40938b752af2a8546 /main/SAPI.c
parentaf7a7a4e363a7b40497a8b99ea58cd7b08fb1b84 (diff)
downloadphp-git-8464abe22ebba93ecd60845e6d683c3c24a61a15.tar.gz
Fixed crashes because of SAPI handlers overrding from inside of dl()-ed extensions
Diffstat (limited to 'main/SAPI.c')
-rw-r--r--main/SAPI.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index 7db33e9e4b..45faa10f98 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -861,6 +861,9 @@ SAPI_API int sapi_register_post_entries(sapi_post_entry *post_entries TSRMLS_DC)
SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC)
{
+ if (EG(in_execution)) {
+ return FAILURE;
+ }
return zend_hash_add(&SG(known_post_content_types),
post_entry->content_type, post_entry->content_type_len+1,
(void *) post_entry, sizeof(sapi_post_entry), NULL);
@@ -868,6 +871,9 @@ SAPI_API int sapi_register_post_entry(sapi_post_entry *post_entry TSRMLS_DC)
SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC)
{
+ if (EG(in_execution)) {
+ return;
+ }
zend_hash_del(&SG(known_post_content_types), post_entry->content_type,
post_entry->content_type_len+1);
}
@@ -875,6 +881,9 @@ SAPI_API void sapi_unregister_post_entry(sapi_post_entry *post_entry TSRMLS_DC)
SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRMLS_D))
{
+ if (EG(in_execution)) {
+ return FAILURE;
+ }
sapi_module.default_post_reader = default_post_reader;
return SUCCESS;
}
@@ -882,12 +891,18 @@ SAPI_API int sapi_register_default_post_reader(void (*default_post_reader)(TSRML
SAPI_API int sapi_register_treat_data(void (*treat_data)(int arg, char *str, zval *destArray TSRMLS_DC))
{
+ if (EG(in_execution)) {
+ return FAILURE;
+ }
sapi_module.treat_data = treat_data;
return SUCCESS;
}
SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, char *var, char **val, unsigned int val_len, unsigned int *new_val_len TSRMLS_DC))
{
+ if (EG(in_execution)) {
+ return FAILURE;
+ }
sapi_module.input_filter = input_filter;
return SUCCESS;
}