]> granicus.if.org Git - php/commitdiff
Don't expect a path for tidy_repair_string() and fix the tests
authorRasmus Lerdorf <rasmus@php.net>
Sun, 12 Jun 2011 14:49:10 +0000 (14:49 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Sun, 12 Jun 2011 14:49:10 +0000 (14:49 +0000)
ext/tidy/tests/019.phpt
ext/tidy/tests/022.phpt
ext/tidy/tidy.c

index 91bbc016edb260615e40e0d341c3c6602b5e3dcb..5e9c38d75a3be19da32d0b941b76d45a0a818d9f 100644 (file)
@@ -38,5 +38,5 @@ Warning: tidy_repair_file(): Filename cannot be empty in %s on line %d
 
 Warning: tidy_repair_file(): Filename cannot be empty in %s on line %d
 
-Warning: tidy_repair_file() expects parameter 1 to be string, array given in %s on line %d
+Warning: tidy_repair_file() expects parameter 1 to be a valid path, array given in %s on line %d
 Done
index 91bbc016edb260615e40e0d341c3c6602b5e3dcb..5e9c38d75a3be19da32d0b941b76d45a0a818d9f 100644 (file)
@@ -38,5 +38,5 @@ Warning: tidy_repair_file(): Filename cannot be empty in %s on line %d
 
 Warning: tidy_repair_file(): Filename cannot be empty in %s on line %d
 
-Warning: tidy_repair_file() expects parameter 1 to be string, array given in %s on line %d
+Warning: tidy_repair_file() expects parameter 1 to be a valid path, array given in %s on line %d
 Done
index cf8e29056919f39e41fd50af34b0d0e0020cc798..2b859683f3d2d953c86f75473a6fd4f631aa12dc 100644 (file)
@@ -558,15 +558,17 @@ static void php_tidy_quick_repair(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_fil
        TidyBuffer *errbuf;
        zval **config = NULL;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|Zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
-               RETURN_FALSE;
-       }
-       
        if (is_file) {
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|Zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
+                       RETURN_FALSE;
+               }
                if (!(data = php_tidy_file_to_mem(arg1, use_include_path, &data_len TSRMLS_CC))) {
                        RETURN_FALSE;
                }
        } else {
+               if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|Zsb", &arg1, &arg1_len, &config, &enc, &enc_len, &use_include_path) == FAILURE) {
+                       RETURN_FALSE;
+               }
                data = arg1;
                data_len = arg1_len;
        }