Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
preprocess example
if
(
$type
&
(
SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML
)
)
{
if
(
!
class_exists
(
'DOMDocument'
)
)
{
throw
new
SimplePie_Exception
(
'DOMDocument not found, unable to use sanitizer'
)
;
}
$document
=
new
DOMDocument
(
)
;
$document
->encoding = 'UTF-8';
$data
=
$this
->
preprocess
(
$data
,
$type
)
;
set_error_handler
(
array
(
'SimplePie_Misc', 'silence_errors'
)
)
;
$document
->
loadHTML
(
$data
)
;
restore_error_handler
(
)
;
$xpath
=
new
DOMXPath
(
$document
)
;
// Strip comments
if
(
$this
->strip_comments
)
{
$comments
=
$xpath
->
query
(
'//comment()'
)
;