#44775 [Opn]: tidy::isHtml() method not defined

From: Date: Fri, 18 Apr 2008 14:07:27 +0000
Subject: #44775 [Opn]: tidy::isHtml() method not defined
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-124362@lists.php.net to get a copy of this message
 ID:               44775
 User updated by:  nick at carbidefinger dot net
 Reported By:      nick at carbidefinger dot net
 Status:           Open
 Bug Type:         Unknown/Other Function
 Operating System: Linux
 PHP Version:      5.2.5
 New Comment:

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!)


Previous Comments:
------------------------------------------------------------------------

[2008-04-18 14:05:49] 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()


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44775&edit=1



Thread (4 messages)

« previous php.bugs (#124362) next »