diff options
| author | Nuno Lopes <nlopess@php.net> | 2006-07-08 00:13:17 +0000 |
|---|---|---|
| committer | Nuno Lopes <nlopess@php.net> | 2006-07-08 00:13:17 +0000 |
| commit | c26991a9eb850ec9aa4a90c0e7891a0bbf814665 (patch) | |
| tree | d219e5248baaed5b55aa9ef642984cd1cd450339 /ext/tidy | |
| parent | 8b139b654d386a0c058a3acd59c001540a65630a (diff) | |
| download | php-git-c26991a9eb850ec9aa4a90c0e7891a0bbf814665.tar.gz | |
MFH
Diffstat (limited to 'ext/tidy')
| -rw-r--r-- | ext/tidy/tidy.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index 40f4ff567b..01cf439d18 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -91,9 +91,13 @@ } else { \ convert_to_string_ex(&_val); \ TIDY_SAFE_MODE_CHECK(Z_STRVAL_P(_val)); \ - if (tidyLoadConfig(_doc, Z_STRVAL_P(_val)) < 0) { \ + switch (tidyLoadConfig(_doc, Z_STRVAL_P(_val))) { \ + case -1: \ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(_val)); \ - RETURN_FALSE; \ + break; \ + case 1: \ + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There were errors while parsing the configuration file '%s'", Z_STRVAL_P(_val)); \ + break; \ } \ } \ } @@ -311,10 +315,6 @@ zend_function_entry tidy_funcs_node[] = { {NULL, NULL, NULL} }; -zend_function_entry tidy_funcs_exception[] = { - {NULL, NULL, NULL} -}; - zend_class_entry *tidy_ce_doc, *tidy_ce_node, *tidy_ce_exception; static zend_object_handlers tidy_object_handlers_doc; @@ -342,22 +342,22 @@ zend_module_entry tidy_module_entry = { ZEND_GET_MODULE(tidy) #endif -void* TIDY_CALL php_tidy_malloc(size_t len) +static void* TIDY_CALL php_tidy_malloc(size_t len) { return emalloc(len); } -void* TIDY_CALL php_tidy_realloc(void *buf, size_t len) +static void* TIDY_CALL php_tidy_realloc(void *buf, size_t len) { return erealloc(buf, len); } -void TIDY_CALL php_tidy_free(void *buf) +static void TIDY_CALL php_tidy_free(void *buf) { efree(buf); } -void TIDY_CALL php_tidy_panic(ctmbstr msg) +static void TIDY_CALL php_tidy_panic(ctmbstr msg) { TSRMLS_FETCH(); php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not allocate memory for tidy! (Reason: %s)", (char *)msg); @@ -463,19 +463,8 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil TIDY_SET_DEFAULT_CONFIG(doc); - /* We can't use TIDY_APPLY_CONFIG_ZVAL() here, it uses RETURN_FALSE */ - if (ZEND_NUM_ARGS() > 1) { - if(Z_TYPE_P(config) == IS_ARRAY) { - _php_tidy_apply_config_array(doc, HASH_OF(config) TSRMLS_CC); - } else { - convert_to_string_ex(&config); - TIDY_SAFE_MODE_CHECK(Z_STRVAL_P(config)); - if (tidyLoadConfig(doc, Z_STRVAL_P(config)) < 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(config)); - RETVAL_FALSE; - } - } + TIDY_APPLY_CONFIG_ZVAL(doc, config); } if(enc_len) { |
