equal
deleted
inserted
replaced
62 var $base_location = 0; |
62 var $base_location = 0; |
63 var $checked_feeds = 0; |
63 var $checked_feeds = 0; |
64 var $max_checked_feeds = 10; |
64 var $max_checked_feeds = 10; |
65 var $force_fsockopen = false; |
65 var $force_fsockopen = false; |
66 var $curl_options = array(); |
66 var $curl_options = array(); |
|
67 var $dom; |
67 protected $registry; |
68 protected $registry; |
68 |
69 |
69 public function __construct(SimplePie_File $file, $timeout = 10, $useragent = null, $max_checked_feeds = 10, $force_fsockopen = false, $curl_options = array()) |
70 public function __construct(SimplePie_File $file, $timeout = 10, $useragent = null, $max_checked_feeds = 10, $force_fsockopen = false, $curl_options = array()) |
70 { |
71 { |
71 $this->file = $file; |
72 $this->file = $file; |
73 $this->timeout = $timeout; |
74 $this->timeout = $timeout; |
74 $this->max_checked_feeds = $max_checked_feeds; |
75 $this->max_checked_feeds = $max_checked_feeds; |
75 $this->force_fsockopen = $force_fsockopen; |
76 $this->force_fsockopen = $force_fsockopen; |
76 $this->curl_options = $curl_options; |
77 $this->curl_options = $curl_options; |
77 |
78 |
78 if (class_exists('DOMDocument')) |
79 if (class_exists('DOMDocument') && $this->file->body != '') |
79 { |
80 { |
80 $this->dom = new DOMDocument(); |
81 $this->dom = new DOMDocument(); |
81 |
82 |
82 set_error_handler(array('SimplePie_Misc', 'silence_errors')); |
83 set_error_handler(array('SimplePie_Misc', 'silence_errors')); |
83 $this->dom->loadHTML($this->file->body); |
84 try |
|
85 { |
|
86 $this->dom->loadHTML($this->file->body); |
|
87 } |
|
88 catch (Throwable $ex) |
|
89 { |
|
90 $this->dom = null; |
|
91 } |
84 restore_error_handler(); |
92 restore_error_handler(); |
85 } |
93 } |
86 else |
94 else |
87 { |
95 { |
88 $this->dom = null; |
96 $this->dom = null; |