php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44775 tidy::isHtml() method not defined
Submitted: 2008-04-18 14:05 UTC Modified: 2010-12-20 10:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nick at carbidefinger dot net Assigned:
Status: Not a bug Package: Tidy (PECL)
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
 [2008-04-18 14:05 UTC] nick at carbidefinger dot net
Description:
------------
This function is no longer defined, running it results in:

Call to undefined method tidy::isHtml()

Seeing as tidy::isXhtml() is not implemented yet and always returns false - i'm a bit stuck!

Reproduce code:
---------------
$response = $this->getResponse();
		$tidycf = array(
					   'indent'         => true,
					   'output-xhtml'   => true,
					   'char-encoding' => 'utf8',
					   'wrap'           => 200);
		
		// Tidy
		if (!$response->isException()) {
			$tidy = new tidy;
			$tidy->parseString($response, $tidycf, 'utf8');
			
			if ($tidy->isHtml()) {
				$tidy->cleanRepair();
				$this->getResponse()->clearBody();
				echo $tidy;
			} else {
				$this->getResponse()->appendBody("This Page Was Not Cleaned By Tidy\n");
				}
			}
		}

Expected result:
----------------
Anything that isnt HTML being passed from the $reponse object should have a string appended to it, any HTML should be cleaned by the tidy library.

Actual result:
--------------
Fatal error: Call to undefined method tidy::isHtml()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-18 14:07 UTC] nick at carbidefinger dot net
there is a typo in my code! doh!

the } following "$this->getResponse()->appendBody("This Page Was Not Cleaned By Tidy\n");" shouldnt be there (I removed some code from the post and missed it!)
 [2008-04-18 15:37 UTC] nick at carbidefinger dot net
Tidy snippet from phpinfo();

Tidy support  	 enabled
libTidy Release 	6 November 2007
Extension Version 	2.0 ($Id: tidy.c,v 1.66.2.8.2.24 2007/09/20 22:25:05 nlopess Exp $)
 [2008-04-20 14:31 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

isHTML is a Tidy node method, not a tidy object one.
 [2010-12-20 10:00 UTC] jani@php.net
-Package: Unknown/Other Function +Package: Tidy
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC