nlopess                                  Sat, 21 Jan 2012 11:32:56 +0000

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

Log:
revert r319254 (fix bug #54682) since it is not correct
add test that was broken with that patch.
this bug is probably in libtidy itself and not in PHP. I didn't investigate it 
enough to confirm, though

Bug: https://bugs.php.net/54682 (Re-Opened) tidy NullPD
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/tidy/tests/004.phpt
    U   php/php-src/branches/PHP_5_3/ext/tidy/tidy.c
    U   php/php-src/branches/PHP_5_4/ext/tidy/tests/004.phpt
    U   php/php-src/branches/PHP_5_4/ext/tidy/tidy.c
    U   php/php-src/trunk/ext/tidy/tests/004.phpt
    U   php/php-src/trunk/ext/tidy/tidy.c

Modified: php/php-src/branches/PHP_5_3/ext/tidy/tests/004.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/tidy/tests/004.phpt        2012-01-21 
05:24:58 UTC (rev 322535)
+++ php/php-src/branches/PHP_5_3/ext/tidy/tests/004.phpt        2012-01-21 
11:32:56 UTC (rev 322536)
@@ -4,14 +4,28 @@
 <?php if (!extension_loaded("tidy")) print "skip"; ?>
 --FILE--
 <?php
-       $a = tidy_parse_string("<HTML></HTML>");
-       tidy_diagnose($a);
-       echo tidy_get_error_buffer($a);
+$a = tidy_parse_string('<HTML></HTML>');
+var_dump(tidy_diagnose($a));
+echo tidy_get_error_buffer($a);
+
+$html = <<< HTML
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<html>
+<head><title>foo</title></head>
+<body><p>hello</p></body>
+</html>
+HTML;
+$a = tidy_parse_string($html);
+var_dump(tidy_diagnose($a));
+echo tidy_get_error_buffer($a);
 ?>
 --EXPECT--
-
+bool(true)
 line 1 column 1 - Warning: missing <!DOCTYPE> declaration
 line 1 column 7 - Warning: discarding unexpected </html>
 line 1 column 14 - Warning: inserting missing 'title' element
 Info: Document content looks like HTML 3.2
-3 warnings, 0 errors were found!
\ No newline at end of file
+3 warnings, 0 errors were found!
+bool(true)
+Info: Document content looks like HTML 3.2
+No warnings or errors were found.

Modified: php/php-src/branches/PHP_5_3/ext/tidy/tidy.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/tidy/tidy.c        2012-01-21 05:24:58 UTC 
(rev 322535)
+++ php/php-src/branches/PHP_5_3/ext/tidy/tidy.c        2012-01-21 11:32:56 UTC 
(rev 322536)
@@ -1288,7 +1288,7 @@
 {
        TIDY_FETCH_OBJECT;

-       if (tidyStatus(obj->ptdoc->doc) != 0 && 
tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
+       if (tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
                tidy_doc_update_properties(obj TSRMLS_CC);
                RETURN_TRUE;
        }

Modified: php/php-src/branches/PHP_5_4/ext/tidy/tests/004.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/tidy/tests/004.phpt        2012-01-21 
05:24:58 UTC (rev 322535)
+++ php/php-src/branches/PHP_5_4/ext/tidy/tests/004.phpt        2012-01-21 
11:32:56 UTC (rev 322536)
@@ -4,14 +4,28 @@
 <?php if (!extension_loaded("tidy")) print "skip"; ?>
 --FILE--
 <?php
-       $a = tidy_parse_string("<HTML></HTML>");
-       tidy_diagnose($a);
-       echo tidy_get_error_buffer($a);
+$a = tidy_parse_string('<HTML></HTML>');
+var_dump(tidy_diagnose($a));
+echo tidy_get_error_buffer($a);
+
+$html = <<< HTML
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<html>
+<head><title>foo</title></head>
+<body><p>hello</p></body>
+</html>
+HTML;
+$a = tidy_parse_string($html);
+var_dump(tidy_diagnose($a));
+echo tidy_get_error_buffer($a);
 ?>
 --EXPECT--
-
+bool(true)
 line 1 column 1 - Warning: missing <!DOCTYPE> declaration
 line 1 column 7 - Warning: discarding unexpected </html>
 line 1 column 14 - Warning: inserting missing 'title' element
 Info: Document content looks like HTML 3.2
-3 warnings, 0 errors were found!
\ No newline at end of file
+3 warnings, 0 errors were found!
+bool(true)
+Info: Document content looks like HTML 3.2
+No warnings or errors were found.

Modified: php/php-src/branches/PHP_5_4/ext/tidy/tidy.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/tidy/tidy.c        2012-01-21 05:24:58 UTC 
(rev 322535)
+++ php/php-src/branches/PHP_5_4/ext/tidy/tidy.c        2012-01-21 11:32:56 UTC 
(rev 322536)
@@ -1336,7 +1336,7 @@
 {
        TIDY_FETCH_OBJECT;

-       if (tidyStatus(obj->ptdoc->doc) != 0 && 
tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
+       if (tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
                tidy_doc_update_properties(obj TSRMLS_CC);
                RETURN_TRUE;
        }

Modified: php/php-src/trunk/ext/tidy/tests/004.phpt
===================================================================
--- php/php-src/trunk/ext/tidy/tests/004.phpt   2012-01-21 05:24:58 UTC (rev 
322535)
+++ php/php-src/trunk/ext/tidy/tests/004.phpt   2012-01-21 11:32:56 UTC (rev 
322536)
@@ -4,14 +4,28 @@
 <?php if (!extension_loaded("tidy")) print "skip"; ?>
 --FILE--
 <?php
-       $a = tidy_parse_string("<HTML></HTML>");
-       tidy_diagnose($a);
-       echo tidy_get_error_buffer($a);
+$a = tidy_parse_string('<HTML></HTML>');
+var_dump(tidy_diagnose($a));
+echo tidy_get_error_buffer($a);
+
+$html = <<< HTML
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<html>
+<head><title>foo</title></head>
+<body><p>hello</p></body>
+</html>
+HTML;
+$a = tidy_parse_string($html);
+var_dump(tidy_diagnose($a));
+echo tidy_get_error_buffer($a);
 ?>
 --EXPECT--
-
+bool(true)
 line 1 column 1 - Warning: missing <!DOCTYPE> declaration
 line 1 column 7 - Warning: discarding unexpected </html>
 line 1 column 14 - Warning: inserting missing 'title' element
 Info: Document content looks like HTML 3.2
-3 warnings, 0 errors were found!
\ No newline at end of file
+3 warnings, 0 errors were found!
+bool(true)
+Info: Document content looks like HTML 3.2
+No warnings or errors were found.

Modified: php/php-src/trunk/ext/tidy/tidy.c
===================================================================
--- php/php-src/trunk/ext/tidy/tidy.c   2012-01-21 05:24:58 UTC (rev 322535)
+++ php/php-src/trunk/ext/tidy/tidy.c   2012-01-21 11:32:56 UTC (rev 322536)
@@ -1336,7 +1336,7 @@
 {
        TIDY_FETCH_OBJECT;

-       if (tidyStatus(obj->ptdoc->doc) != 0 && 
tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
+       if (tidyRunDiagnostics(obj->ptdoc->doc) >= 0) {
                tidy_doc_update_properties(obj TSRMLS_CC);
                RETURN_TRUE;
        }

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

Reply via email to