]> granicus.if.org Git - php/commitdiff
Use defined macro
authorXinchen Hui <laruence@php.net>
Wed, 14 May 2014 08:54:14 +0000 (16:54 +0800)
committerXinchen Hui <laruence@php.net>
Wed, 14 May 2014 08:54:14 +0000 (16:54 +0800)
ext/tidy/tidy.c

index c9f910753004c32771dd5d9f0402d71b0747dc19..5617dca7d69ef4d5a26d06699b3e020ac2dcfc7c 100644 (file)
@@ -592,20 +592,7 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
        TIDY_SET_DEFAULT_CONFIG(doc);
        
        if (config) {
-        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_OPEN_BASE_DIR_CHECK(Z_STRVAL_P(config)); 
-            switch (tidyLoadConfig(doc, Z_STRVAL_P(config))) { 
-              case -1: 
-                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load configuration file '%s'", Z_STRVAL_P(config)); 
-                break; 
-              case 1: 
-                php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There were errors while parsing the configuration file '%s'", Z_STRVAL_P(config)); 
-                break; 
-            } 
-        } 
+               TIDY_APPLY_CONFIG_ZVAL(doc, config);
        }
 
        if(enc_len) {