Skip to content
This repository
Browse code

If DOMDocument doesn't exist, nicely fail Sanitize

See #241. This fixes it for 1.3.2, but requires different changes for 1.4.
  • Loading branch information...
commit 16160017bf904538c3fe4cacadc1aba19d445106 1 parent 38eac68
Ryan McCue rmccue authored

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. +5 0 library/SimplePie/Sanitize.php
5 library/SimplePie/Sanitize.php
@@ -247,6 +247,11 @@ public function sanitize($data, $type, $base = '')
247 247 if ($type & (SIMPLEPIE_CONSTRUCT_HTML | SIMPLEPIE_CONSTRUCT_XHTML))
248 248 {
249 249
  250 + if (!class_exists('DOMDocument'))
  251 + {
  252 + $this->registry->call('Misc', 'error', array('DOMDocument not found, unable to use sanitizer', E_USER_WARNING, __FILE__, __LINE__));
  253 + return '';
  254 + }
250 255 $document = new DOMDocument();
251 256 $document->encoding = 'UTF-8';
252 257 $data = $this->preprocess($data, $type);

0 comments on commit 1616001

Please sign in to comment.
Something went wrong with that request. Please try again.