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:
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 $)
Previous Comments:
------------------------------------------------------------------------
[2008-04-18 14:07:27] 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 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