rasmus                                   Sun, 12 Jun 2011 14:49:10 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=312101

Log:
Don't expect a path for tidy_repair_string() and fix the tests

Changed paths:
    U   php/php-src/branches/PHP_5_4/ext/tidy/tests/019.phpt
    U   php/php-src/branches/PHP_5_4/ext/tidy/tests/022.phpt
    U   php/php-src/branches/PHP_5_4/ext/tidy/tidy.c
    U   php/php-src/trunk/ext/tidy/tests/019.phpt
    U   php/php-src/trunk/ext/tidy/tests/022.phpt
    U   php/php-src/trunk/ext/tidy/tidy.c

Modified: php/php-src/branches/PHP_5_4/ext/tidy/tests/019.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/tidy/tests/019.phpt        2011-06-12 
14:48:11 UTC (rev 312100)
+++ php/php-src/branches/PHP_5_4/ext/tidy/tests/019.phpt        2011-06-12 
14:49:10 UTC (rev 312101)
@@ -38,5 +38,5 @@

 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

Modified: php/php-src/branches/PHP_5_4/ext/tidy/tests/022.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/tidy/tests/022.phpt        2011-06-12 
14:48:11 UTC (rev 312100)
+++ php/php-src/branches/PHP_5_4/ext/tidy/tests/022.phpt        2011-06-12 
14:49:10 UTC (rev 312101)
@@ -38,5 +38,5 @@

 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

Modified: php/php-src/branches/PHP_5_4/ext/tidy/tidy.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/tidy/tidy.c        2011-06-12 14:48:11 UTC 
(rev 312100)
+++ php/php-src/branches/PHP_5_4/ext/tidy/tidy.c        2011-06-12 14:49:10 UTC 
(rev 312101)
@@ -558,15 +558,17 @@
        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;
        }

Modified: php/php-src/trunk/ext/tidy/tests/019.phpt
===================================================================
--- php/php-src/trunk/ext/tidy/tests/019.phpt   2011-06-12 14:48:11 UTC (rev 
312100)
+++ php/php-src/trunk/ext/tidy/tests/019.phpt   2011-06-12 14:49:10 UTC (rev 
312101)
@@ -38,5 +38,5 @@

 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

Modified: php/php-src/trunk/ext/tidy/tests/022.phpt
===================================================================
--- php/php-src/trunk/ext/tidy/tests/022.phpt   2011-06-12 14:48:11 UTC (rev 
312100)
+++ php/php-src/trunk/ext/tidy/tests/022.phpt   2011-06-12 14:49:10 UTC (rev 
312101)
@@ -38,5 +38,5 @@

 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

Modified: php/php-src/trunk/ext/tidy/tidy.c
===================================================================
--- php/php-src/trunk/ext/tidy/tidy.c   2011-06-12 14:48:11 UTC (rev 312100)
+++ php/php-src/trunk/ext/tidy/tidy.c   2011-06-12 14:49:10 UTC (rev 312101)
@@ -558,15 +558,17 @@
        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;
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to