note 77932 deleted from function.tidy-get-body by nlopess
| From: | nlopess@php.net | Date: | Thu, 20 Sep 2007 21:17:36 +0000 |
| Subject: | note 77932 deleted from function.tidy-get-body by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130641@lists.php.net to get a copy of this message | ||
Note Submitter: nyos at nyos homelinux net
----
Make sure your site has a body tag before using this function (or get the whole page, and use other
tidy functions to navigate to the body)!
If it's a (syntactically) incorrect page, you can even get a segmentation fault.
#!/usr/bin/php
<?
/*
$file_data='
<html>
<frameset >
</frameset>
</html>
';
*/
$file_data='
<frameset >
</frameset>
';
$t=tidy_parse_string(trim($file_data));
$t->cleanRepair();
echo "following line segfaults..\n";
$body=tidy_get_body($t);
echo "..or works?\n";
?>
output:
nyos@falken:~/webmasters/tidybug$ ./tidy.php
following line segfaults..
Segmentation fault (core dumped)
(bug will be reported soon)