Version Description
Download this release
Release Info
Developer | hallsofmontezuma |
Plugin | Acunetix WP Security |
Version | 2.3.6 |
Comparing to | |
See all releases |
Code changes from version 2.3.5 to 2.3.6
- readme.txt +1 -1
- securityscan.php +4 -1
- simplepie.inc +2 -1016
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: security, securityscan, chmod, permissions, admin, administration, authent
|
|
5 |
plugins, private, protection, tracking, wordpress
|
6 |
Requires at least: 2.3
|
7 |
Tested up to: 2.7.1
|
8 |
-
Stable tag: 2.3.
|
9 |
|
10 |
Scans your WordPress installation for security vulnerabilities.
|
11 |
|
5 |
plugins, private, protection, tracking, wordpress
|
6 |
Requires at least: 2.3
|
7 |
Tested up to: 2.7.1
|
8 |
+
Stable tag: 2.3.6
|
9 |
|
10 |
Scans your WordPress installation for security vulnerabilities.
|
11 |
|
securityscan.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Security Scan
|
|
4 |
Plugin URI: http://semperfiwebdesign.com/plugins/wp-security-scan/
|
5 |
Description: Perform security scan of WordPress installation.
|
6 |
Author: Michael Torbert
|
7 |
-
Version: 2.3.
|
8 |
Author URI: http://semperfiwebdesign.com/
|
9 |
*/
|
10 |
|
@@ -30,7 +30,9 @@ require_once(ABSPATH."wp-content/plugins/wp-security-scan/scanner.php");
|
|
30 |
require_once(ABSPATH."wp-content/plugins/wp-security-scan/password_tools.php");
|
31 |
require_once(ABSPATH."wp-content/plugins/wp-security-scan/database.php");
|
32 |
require_once(ABSPATH."wp-content/plugins/wp-security-scan/functions.php");
|
|
|
33 |
require_once(ABSPATH."wp-content/plugins/wp-security-scan/simplepie.inc");
|
|
|
34 |
//require_once(ABSPATH."wp-content/plugins/wp-security-scan/scripts.js");
|
35 |
|
36 |
|
@@ -123,6 +125,7 @@ if($mrt_latest > $mrt_version)
|
|
123 |
|
124 |
$feed->set_feed_url('feed://donations.semperfiwebdesign.com/category/highest-donations/feed/');
|
125 |
$feed->strip_htmltags(array('p'));
|
|
|
126 |
$feed->init();
|
127 |
$feed->handle_content_type();
|
128 |
?>
|
4 |
Plugin URI: http://semperfiwebdesign.com/plugins/wp-security-scan/
|
5 |
Description: Perform security scan of WordPress installation.
|
6 |
Author: Michael Torbert
|
7 |
+
Version: 2.3.6
|
8 |
Author URI: http://semperfiwebdesign.com/
|
9 |
*/
|
10 |
|
30 |
require_once(ABSPATH."wp-content/plugins/wp-security-scan/password_tools.php");
|
31 |
require_once(ABSPATH."wp-content/plugins/wp-security-scan/database.php");
|
32 |
require_once(ABSPATH."wp-content/plugins/wp-security-scan/functions.php");
|
33 |
+
if(!class_exists("SimplePie")){
|
34 |
require_once(ABSPATH."wp-content/plugins/wp-security-scan/simplepie.inc");
|
35 |
+
}
|
36 |
//require_once(ABSPATH."wp-content/plugins/wp-security-scan/scripts.js");
|
37 |
|
38 |
|
125 |
|
126 |
$feed->set_feed_url('feed://donations.semperfiwebdesign.com/category/highest-donations/feed/');
|
127 |
$feed->strip_htmltags(array('p'));
|
128 |
+
$feed->cache_location('ABSPATH."wp-content/plugins/wp-security-scan/cache/');
|
129 |
$feed->init();
|
130 |
$feed->handle_content_type();
|
131 |
?>
|
simplepie.inc
CHANGED
@@ -1,754 +1,135 @@
|
|
1 |
<?php
|
2 |
-
/**
|
3 |
-
* SimplePie
|
4 |
-
*
|
5 |
-
* A PHP-Based RSS and Atom Feed Framework.
|
6 |
-
* Takes the hard work out of managing a complete RSS/Atom solution.
|
7 |
-
*
|
8 |
-
* Copyright (c) 2004-2008, Ryan Parman and Geoffrey Sneddon
|
9 |
-
* All rights reserved.
|
10 |
-
*
|
11 |
-
* Redistribution and use in source and binary forms, with or without modification, are
|
12 |
-
* permitted provided that the following conditions are met:
|
13 |
-
*
|
14 |
-
* * Redistributions of source code must retain the above copyright notice, this list of
|
15 |
-
* conditions and the following disclaimer.
|
16 |
-
*
|
17 |
-
* * Redistributions in binary form must reproduce the above copyright notice, this list
|
18 |
-
* of conditions and the following disclaimer in the documentation and/or other materials
|
19 |
-
* provided with the distribution.
|
20 |
-
*
|
21 |
-
* * Neither the name of the SimplePie Team nor the names of its contributors may be used
|
22 |
-
* to endorse or promote products derived from this software without specific prior
|
23 |
-
* written permission.
|
24 |
-
*
|
25 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
|
26 |
-
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
27 |
-
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
|
28 |
-
* AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
29 |
-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
30 |
-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
31 |
-
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
32 |
-
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
33 |
-
* POSSIBILITY OF SUCH DAMAGE.
|
34 |
-
*
|
35 |
-
* @package SimplePie
|
36 |
-
* @version 1.1.3
|
37 |
-
* @copyright 2004-2008 Ryan Parman, Geoffrey Sneddon
|
38 |
-
* @author Ryan Parman
|
39 |
-
* @author Geoffrey Sneddon
|
40 |
-
* @link http://simplepie.org/ SimplePie
|
41 |
-
* @link http://simplepie.org/support/ Please submit all bug reports and feature requests to the SimplePie forums
|
42 |
-
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
43 |
-
* @todo phpDoc comments
|
44 |
-
*/
|
45 |
-
|
46 |
-
/**
|
47 |
-
* SimplePie Name
|
48 |
-
*/
|
49 |
define('SIMPLEPIE_NAME', 'SimplePie');
|
50 |
-
|
51 |
-
/**
|
52 |
-
* SimplePie Version
|
53 |
-
*/
|
54 |
define('SIMPLEPIE_VERSION', '1.1.3');
|
55 |
-
|
56 |
-
/**
|
57 |
-
* SimplePie Build
|
58 |
-
*/
|
59 |
define('SIMPLEPIE_BUILD', 20081219);
|
60 |
-
|
61 |
-
/**
|
62 |
-
* SimplePie Website URL
|
63 |
-
*/
|
64 |
define('SIMPLEPIE_URL', 'http://simplepie.org');
|
65 |
-
|
66 |
-
/**
|
67 |
-
* SimplePie Useragent
|
68 |
-
* @see SimplePie::set_useragent()
|
69 |
-
*/
|
70 |
define('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION . ' (Feed Parser; ' . SIMPLEPIE_URL . '; Allow like Gecko) Build/' . SIMPLEPIE_BUILD);
|
71 |
-
|
72 |
-
/**
|
73 |
-
* SimplePie Linkback
|
74 |
-
*/
|
75 |
define('SIMPLEPIE_LINKBACK', '<a href="' . SIMPLEPIE_URL . '" title="' . SIMPLEPIE_NAME . ' ' . SIMPLEPIE_VERSION . '">' . SIMPLEPIE_NAME . '</a>');
|
76 |
-
|
77 |
-
/**
|
78 |
-
* No Autodiscovery
|
79 |
-
* @see SimplePie::set_autodiscovery_level()
|
80 |
-
*/
|
81 |
define('SIMPLEPIE_LOCATOR_NONE', 0);
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Feed Link Element Autodiscovery
|
85 |
-
* @see SimplePie::set_autodiscovery_level()
|
86 |
-
*/
|
87 |
define('SIMPLEPIE_LOCATOR_AUTODISCOVERY', 1);
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Local Feed Extension Autodiscovery
|
91 |
-
* @see SimplePie::set_autodiscovery_level()
|
92 |
-
*/
|
93 |
define('SIMPLEPIE_LOCATOR_LOCAL_EXTENSION', 2);
|
94 |
-
|
95 |
-
/**
|
96 |
-
* Local Feed Body Autodiscovery
|
97 |
-
* @see SimplePie::set_autodiscovery_level()
|
98 |
-
*/
|
99 |
define('SIMPLEPIE_LOCATOR_LOCAL_BODY', 4);
|
100 |
-
|
101 |
-
/**
|
102 |
-
* Remote Feed Extension Autodiscovery
|
103 |
-
* @see SimplePie::set_autodiscovery_level()
|
104 |
-
*/
|
105 |
define('SIMPLEPIE_LOCATOR_REMOTE_EXTENSION', 8);
|
106 |
-
|
107 |
-
/**
|
108 |
-
* Remote Feed Body Autodiscovery
|
109 |
-
* @see SimplePie::set_autodiscovery_level()
|
110 |
-
*/
|
111 |
define('SIMPLEPIE_LOCATOR_REMOTE_BODY', 16);
|
112 |
-
|
113 |
-
/**
|
114 |
-
* All Feed Autodiscovery
|
115 |
-
* @see SimplePie::set_autodiscovery_level()
|
116 |
-
*/
|
117 |
define('SIMPLEPIE_LOCATOR_ALL', 31);
|
118 |
-
|
119 |
-
/**
|
120 |
-
* No known feed type
|
121 |
-
*/
|
122 |
define('SIMPLEPIE_TYPE_NONE', 0);
|
123 |
-
|
124 |
-
/**
|
125 |
-
* RSS 0.90
|
126 |
-
*/
|
127 |
define('SIMPLEPIE_TYPE_RSS_090', 1);
|
128 |
-
|
129 |
-
/**
|
130 |
-
* RSS 0.91 (Netscape)
|
131 |
-
*/
|
132 |
define('SIMPLEPIE_TYPE_RSS_091_NETSCAPE', 2);
|
133 |
-
|
134 |
-
/**
|
135 |
-
* RSS 0.91 (Userland)
|
136 |
-
*/
|
137 |
define('SIMPLEPIE_TYPE_RSS_091_USERLAND', 4);
|
138 |
-
|
139 |
-
/**
|
140 |
-
* RSS 0.91 (both Netscape and Userland)
|
141 |
-
*/
|
142 |
define('SIMPLEPIE_TYPE_RSS_091', 6);
|
143 |
-
|
144 |
-
/**
|
145 |
-
* RSS 0.92
|
146 |
-
*/
|
147 |
define('SIMPLEPIE_TYPE_RSS_092', 8);
|
148 |
-
|
149 |
-
/**
|
150 |
-
* RSS 0.93
|
151 |
-
*/
|
152 |
define('SIMPLEPIE_TYPE_RSS_093', 16);
|
153 |
-
|
154 |
-
/**
|
155 |
-
* RSS 0.94
|
156 |
-
*/
|
157 |
define('SIMPLEPIE_TYPE_RSS_094', 32);
|
158 |
-
|
159 |
-
/**
|
160 |
-
* RSS 1.0
|
161 |
-
*/
|
162 |
define('SIMPLEPIE_TYPE_RSS_10', 64);
|
163 |
-
|
164 |
-
/**
|
165 |
-
* RSS 2.0
|
166 |
-
*/
|
167 |
define('SIMPLEPIE_TYPE_RSS_20', 128);
|
168 |
-
|
169 |
-
/**
|
170 |
-
* RDF-based RSS
|
171 |
-
*/
|
172 |
define('SIMPLEPIE_TYPE_RSS_RDF', 65);
|
173 |
-
|
174 |
-
/**
|
175 |
-
* Non-RDF-based RSS (truly intended as syndication format)
|
176 |
-
*/
|
177 |
define('SIMPLEPIE_TYPE_RSS_SYNDICATION', 190);
|
178 |
-
|
179 |
-
/**
|
180 |
-
* All RSS
|
181 |
-
*/
|
182 |
define('SIMPLEPIE_TYPE_RSS_ALL', 255);
|
183 |
-
|
184 |
-
/**
|
185 |
-
* Atom 0.3
|
186 |
-
*/
|
187 |
define('SIMPLEPIE_TYPE_ATOM_03', 256);
|
188 |
-
|
189 |
-
/**
|
190 |
-
* Atom 1.0
|
191 |
-
*/
|
192 |
define('SIMPLEPIE_TYPE_ATOM_10', 512);
|
193 |
-
|
194 |
-
/**
|
195 |
-
* All Atom
|
196 |
-
*/
|
197 |
define('SIMPLEPIE_TYPE_ATOM_ALL', 768);
|
198 |
-
|
199 |
-
/**
|
200 |
-
* All feed types
|
201 |
-
*/
|
202 |
define('SIMPLEPIE_TYPE_ALL', 1023);
|
203 |
-
|
204 |
-
/**
|
205 |
-
* No construct
|
206 |
-
*/
|
207 |
define('SIMPLEPIE_CONSTRUCT_NONE', 0);
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Text construct
|
211 |
-
*/
|
212 |
define('SIMPLEPIE_CONSTRUCT_TEXT', 1);
|
213 |
-
|
214 |
-
/**
|
215 |
-
* HTML construct
|
216 |
-
*/
|
217 |
define('SIMPLEPIE_CONSTRUCT_HTML', 2);
|
218 |
-
|
219 |
-
/**
|
220 |
-
* XHTML construct
|
221 |
-
*/
|
222 |
define('SIMPLEPIE_CONSTRUCT_XHTML', 4);
|
223 |
-
|
224 |
-
/**
|
225 |
-
* base64-encoded construct
|
226 |
-
*/
|
227 |
define('SIMPLEPIE_CONSTRUCT_BASE64', 8);
|
228 |
-
|
229 |
-
/**
|
230 |
-
* IRI construct
|
231 |
-
*/
|
232 |
define('SIMPLEPIE_CONSTRUCT_IRI', 16);
|
233 |
-
|
234 |
-
/**
|
235 |
-
* A construct that might be HTML
|
236 |
-
*/
|
237 |
define('SIMPLEPIE_CONSTRUCT_MAYBE_HTML', 32);
|
238 |
-
|
239 |
-
/**
|
240 |
-
* All constructs
|
241 |
-
*/
|
242 |
define('SIMPLEPIE_CONSTRUCT_ALL', 63);
|
243 |
-
|
244 |
-
/**
|
245 |
-
* PCRE for HTML attributes
|
246 |
-
*/
|
247 |
define('SIMPLEPIE_PCRE_HTML_ATTRIBUTE', '((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*');
|
248 |
-
|
249 |
-
/**
|
250 |
-
* PCRE for XML attributes
|
251 |
-
*/
|
252 |
define('SIMPLEPIE_PCRE_XML_ATTRIBUTE', '((?:\s+(?:(?:[^\s:]+:)?[^\s:]+)\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\s*');
|
253 |
-
|
254 |
-
/**
|
255 |
-
* XML Namespace
|
256 |
-
*/
|
257 |
define('SIMPLEPIE_NAMESPACE_XML', 'http://www.w3.org/XML/1998/namespace');
|
258 |
-
|
259 |
-
/**
|
260 |
-
* Atom 1.0 Namespace
|
261 |
-
*/
|
262 |
define('SIMPLEPIE_NAMESPACE_ATOM_10', 'http://www.w3.org/2005/Atom');
|
263 |
-
|
264 |
-
/**
|
265 |
-
* Atom 0.3 Namespace
|
266 |
-
*/
|
267 |
define('SIMPLEPIE_NAMESPACE_ATOM_03', 'http://purl.org/atom/ns#');
|
268 |
-
|
269 |
-
/**
|
270 |
-
* RDF Namespace
|
271 |
-
*/
|
272 |
define('SIMPLEPIE_NAMESPACE_RDF', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
|
273 |
-
|
274 |
-
/**
|
275 |
-
* RSS 0.90 Namespace
|
276 |
-
*/
|
277 |
define('SIMPLEPIE_NAMESPACE_RSS_090', 'http://my.netscape.com/rdf/simple/0.9/');
|
278 |
-
|
279 |
-
/**
|
280 |
-
* RSS 1.0 Namespace
|
281 |
-
*/
|
282 |
define('SIMPLEPIE_NAMESPACE_RSS_10', 'http://purl.org/rss/1.0/');
|
283 |
-
|
284 |
-
/**
|
285 |
-
* RSS 1.0 Content Module Namespace
|
286 |
-
*/
|
287 |
define('SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT', 'http://purl.org/rss/1.0/modules/content/');
|
288 |
-
|
289 |
-
/**
|
290 |
-
* RSS 2.0 Namespace
|
291 |
-
* (Stupid, I know, but I'm certain it will confuse people less with support.)
|
292 |
-
*/
|
293 |
define('SIMPLEPIE_NAMESPACE_RSS_20', '');
|
294 |
-
|
295 |
-
/**
|
296 |
-
* DC 1.0 Namespace
|
297 |
-
*/
|
298 |
define('SIMPLEPIE_NAMESPACE_DC_10', 'http://purl.org/dc/elements/1.0/');
|
299 |
-
|
300 |
-
/**
|
301 |
-
* DC 1.1 Namespace
|
302 |
-
*/
|
303 |
define('SIMPLEPIE_NAMESPACE_DC_11', 'http://purl.org/dc/elements/1.1/');
|
304 |
-
|
305 |
-
/**
|
306 |
-
* W3C Basic Geo (WGS84 lat/long) Vocabulary Namespace
|
307 |
-
*/
|
308 |
define('SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO', 'http://www.w3.org/2003/01/geo/wgs84_pos#');
|
309 |
-
|
310 |
-
/**
|
311 |
-
* GeoRSS Namespace
|
312 |
-
*/
|
313 |
define('SIMPLEPIE_NAMESPACE_GEORSS', 'http://www.georss.org/georss');
|
314 |
-
|
315 |
-
/**
|
316 |
-
* Media RSS Namespace
|
317 |
-
*/
|
318 |
define('SIMPLEPIE_NAMESPACE_MEDIARSS', 'http://search.yahoo.com/mrss/');
|
319 |
-
|
320 |
-
/**
|
321 |
-
* Wrong Media RSS Namespace
|
322 |
-
*/
|
323 |
define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG', 'http://search.yahoo.com/mrss');
|
324 |
-
|
325 |
-
/**
|
326 |
-
* iTunes RSS Namespace
|
327 |
-
*/
|
328 |
define('SIMPLEPIE_NAMESPACE_ITUNES', 'http://www.itunes.com/dtds/podcast-1.0.dtd');
|
329 |
-
|
330 |
-
/**
|
331 |
-
* XHTML Namespace
|
332 |
-
*/
|
333 |
define('SIMPLEPIE_NAMESPACE_XHTML', 'http://www.w3.org/1999/xhtml');
|
334 |
-
|
335 |
-
/**
|
336 |
-
* IANA Link Relations Registry
|
337 |
-
*/
|
338 |
define('SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY', 'http://www.iana.org/assignments/relation/');
|
339 |
-
|
340 |
-
/**
|
341 |
-
* Whether we're running on PHP5
|
342 |
-
*/
|
343 |
define('SIMPLEPIE_PHP5', version_compare(PHP_VERSION, '5.0.0', '>='));
|
344 |
-
|
345 |
-
/**
|
346 |
-
* No file source
|
347 |
-
*/
|
348 |
define('SIMPLEPIE_FILE_SOURCE_NONE', 0);
|
349 |
-
|
350 |
-
/**
|
351 |
-
* Remote file source
|
352 |
-
*/
|
353 |
define('SIMPLEPIE_FILE_SOURCE_REMOTE', 1);
|
354 |
-
|
355 |
-
/**
|
356 |
-
* Local file source
|
357 |
-
*/
|
358 |
define('SIMPLEPIE_FILE_SOURCE_LOCAL', 2);
|
359 |
-
|
360 |
-
/**
|
361 |
-
* fsockopen() file source
|
362 |
-
*/
|
363 |
define('SIMPLEPIE_FILE_SOURCE_FSOCKOPEN', 4);
|
364 |
-
|
365 |
-
/**
|
366 |
-
* cURL file source
|
367 |
-
*/
|
368 |
define('SIMPLEPIE_FILE_SOURCE_CURL', 8);
|
369 |
-
|
370 |
-
/**
|
371 |
-
* file_get_contents() file source
|
372 |
-
*/
|
373 |
define('SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS', 16);
|
374 |
-
|
375 |
-
/**
|
376 |
-
* SimplePie
|
377 |
-
*
|
378 |
-
* @package SimplePie
|
379 |
-
* @version "Razzleberry"
|
380 |
-
* @copyright 2004-2007 Ryan Parman, Geoffrey Sneddon
|
381 |
-
* @author Ryan Parman
|
382 |
-
* @author Geoffrey Sneddon
|
383 |
-
* @todo Option for type of fetching (cache, not modified header, fetch, etc.)
|
384 |
-
*/
|
385 |
class SimplePie
|
386 |
{
|
387 |
-
/**
|
388 |
-
* @var array Raw data
|
389 |
-
* @access private
|
390 |
-
*/
|
391 |
var $data = array();
|
392 |
-
|
393 |
-
/**
|
394 |
-
* @var mixed Error string
|
395 |
-
* @access private
|
396 |
-
*/
|
397 |
var $error;
|
398 |
-
|
399 |
-
/**
|
400 |
-
* @var object Instance of SimplePie_Sanitize (or other class)
|
401 |
-
* @see SimplePie::set_sanitize_class()
|
402 |
-
* @access private
|
403 |
-
*/
|
404 |
var $sanitize;
|
405 |
-
|
406 |
-
/**
|
407 |
-
* @var string SimplePie Useragent
|
408 |
-
* @see SimplePie::set_useragent()
|
409 |
-
* @access private
|
410 |
-
*/
|
411 |
var $useragent = SIMPLEPIE_USERAGENT;
|
412 |
-
|
413 |
-
/**
|
414 |
-
* @var string Feed URL
|
415 |
-
* @see SimplePie::set_feed_url()
|
416 |
-
* @access private
|
417 |
-
*/
|
418 |
var $feed_url;
|
419 |
-
|
420 |
-
/**
|
421 |
-
* @var object Instance of SimplePie_File to use as a feed
|
422 |
-
* @see SimplePie::set_file()
|
423 |
-
* @access private
|
424 |
-
*/
|
425 |
var $file;
|
426 |
-
|
427 |
-
/**
|
428 |
-
* @var string Raw feed data
|
429 |
-
* @see SimplePie::set_raw_data()
|
430 |
-
* @access private
|
431 |
-
*/
|
432 |
var $raw_data;
|
433 |
-
|
434 |
-
/**
|
435 |
-
* @var int Timeout for fetching remote files
|
436 |
-
* @see SimplePie::set_timeout()
|
437 |
-
* @access private
|
438 |
-
*/
|
439 |
var $timeout = 10;
|
440 |
-
|
441 |
-
/**
|
442 |
-
* @var bool Forces fsockopen() to be used for remote files instead
|
443 |
-
* of cURL, even if a new enough version is installed
|
444 |
-
* @see SimplePie::force_fsockopen()
|
445 |
-
* @access private
|
446 |
-
*/
|
447 |
var $force_fsockopen = false;
|
448 |
-
|
449 |
-
/**
|
450 |
-
* @var bool Force the given data/URL to be treated as a feed no matter what
|
451 |
-
* it appears like
|
452 |
-
* @see SimplePie::force_feed()
|
453 |
-
* @access private
|
454 |
-
*/
|
455 |
var $force_feed = false;
|
456 |
-
|
457 |
-
/**
|
458 |
-
* @var bool Enable/Disable XML dump
|
459 |
-
* @see SimplePie::enable_xml_dump()
|
460 |
-
* @access private
|
461 |
-
*/
|
462 |
var $xml_dump = false;
|
463 |
-
|
464 |
-
/**
|
465 |
-
* @var bool Enable/Disable Caching
|
466 |
-
* @see SimplePie::enable_cache()
|
467 |
-
* @access private
|
468 |
-
*/
|
469 |
var $cache = true;
|
470 |
-
|
471 |
-
/**
|
472 |
-
* @var int Cache duration (in seconds)
|
473 |
-
* @see SimplePie::set_cache_duration()
|
474 |
-
* @access private
|
475 |
-
*/
|
476 |
var $cache_duration = 3600;
|
477 |
-
|
478 |
-
/**
|
479 |
-
* @var int Auto-discovery cache duration (in seconds)
|
480 |
-
* @see SimplePie::set_autodiscovery_cache_duration()
|
481 |
-
* @access private
|
482 |
-
*/
|
483 |
var $autodiscovery_cache_duration = 604800; // 7 Days.
|
484 |
-
|
485 |
-
/**
|
486 |
-
* @var string Cache location (relative to executing script)
|
487 |
-
* @see SimplePie::set_cache_location()
|
488 |
-
* @access private
|
489 |
-
*/
|
490 |
var $cache_location = './cache';
|
491 |
-
|
492 |
-
/**
|
493 |
-
* @var string Function that creates the cache filename
|
494 |
-
* @see SimplePie::set_cache_name_function()
|
495 |
-
* @access private
|
496 |
-
*/
|
497 |
var $cache_name_function = 'md5';
|
498 |
-
|
499 |
-
/**
|
500 |
-
* @var bool Reorder feed by date descending
|
501 |
-
* @see SimplePie::enable_order_by_date()
|
502 |
-
* @access private
|
503 |
-
*/
|
504 |
var $order_by_date = true;
|
505 |
-
|
506 |
-
/**
|
507 |
-
* @var mixed Force input encoding to be set to the follow value
|
508 |
-
* (false, or anything type-cast to false, disables this feature)
|
509 |
-
* @see SimplePie::set_input_encoding()
|
510 |
-
* @access private
|
511 |
-
*/
|
512 |
var $input_encoding = false;
|
513 |
-
|
514 |
-
/**
|
515 |
-
* @var int Feed Autodiscovery Level
|
516 |
-
* @see SimplePie::set_autodiscovery_level()
|
517 |
-
* @access private
|
518 |
-
*/
|
519 |
var $autodiscovery = SIMPLEPIE_LOCATOR_ALL;
|
520 |
-
|
521 |
-
/**
|
522 |
-
* @var string Class used for caching feeds
|
523 |
-
* @see SimplePie::set_cache_class()
|
524 |
-
* @access private
|
525 |
-
*/
|
526 |
var $cache_class = 'SimplePie_Cache';
|
527 |
-
|
528 |
-
/**
|
529 |
-
* @var string Class used for locating feeds
|
530 |
-
* @see SimplePie::set_locator_class()
|
531 |
-
* @access private
|
532 |
-
*/
|
533 |
var $locator_class = 'SimplePie_Locator';
|
534 |
-
|
535 |
-
/**
|
536 |
-
* @var string Class used for parsing feeds
|
537 |
-
* @see SimplePie::set_parser_class()
|
538 |
-
* @access private
|
539 |
-
*/
|
540 |
var $parser_class = 'SimplePie_Parser';
|
541 |
-
|
542 |
-
/**
|
543 |
-
* @var string Class used for fetching feeds
|
544 |
-
* @see SimplePie::set_file_class()
|
545 |
-
* @access private
|
546 |
-
*/
|
547 |
var $file_class = 'SimplePie_File';
|
548 |
-
|
549 |
-
/**
|
550 |
-
* @var string Class used for items
|
551 |
-
* @see SimplePie::set_item_class()
|
552 |
-
* @access private
|
553 |
-
*/
|
554 |
var $item_class = 'SimplePie_Item';
|
555 |
-
|
556 |
-
/**
|
557 |
-
* @var string Class used for authors
|
558 |
-
* @see SimplePie::set_author_class()
|
559 |
-
* @access private
|
560 |
-
*/
|
561 |
var $author_class = 'SimplePie_Author';
|
562 |
-
|
563 |
-
/**
|
564 |
-
* @var string Class used for categories
|
565 |
-
* @see SimplePie::set_category_class()
|
566 |
-
* @access private
|
567 |
-
*/
|
568 |
var $category_class = 'SimplePie_Category';
|
569 |
-
|
570 |
-
/**
|
571 |
-
* @var string Class used for enclosures
|
572 |
-
* @see SimplePie::set_enclosures_class()
|
573 |
-
* @access private
|
574 |
-
*/
|
575 |
var $enclosure_class = 'SimplePie_Enclosure';
|
576 |
-
|
577 |
-
/**
|
578 |
-
* @var string Class used for Media RSS <media:text> captions
|
579 |
-
* @see SimplePie::set_caption_class()
|
580 |
-
* @access private
|
581 |
-
*/
|
582 |
var $caption_class = 'SimplePie_Caption';
|
583 |
-
|
584 |
-
/**
|
585 |
-
* @var string Class used for Media RSS <media:copyright>
|
586 |
-
* @see SimplePie::set_copyright_class()
|
587 |
-
* @access private
|
588 |
-
*/
|
589 |
var $copyright_class = 'SimplePie_Copyright';
|
590 |
-
|
591 |
-
/**
|
592 |
-
* @var string Class used for Media RSS <media:credit>
|
593 |
-
* @see SimplePie::set_credit_class()
|
594 |
-
* @access private
|
595 |
-
*/
|
596 |
var $credit_class = 'SimplePie_Credit';
|
597 |
-
|
598 |
-
/**
|
599 |
-
* @var string Class used for Media RSS <media:rating>
|
600 |
-
* @see SimplePie::set_rating_class()
|
601 |
-
* @access private
|
602 |
-
*/
|
603 |
var $rating_class = 'SimplePie_Rating';
|
604 |
-
|
605 |
-
/**
|
606 |
-
* @var string Class used for Media RSS <media:restriction>
|
607 |
-
* @see SimplePie::set_restriction_class()
|
608 |
-
* @access private
|
609 |
-
*/
|
610 |
var $restriction_class = 'SimplePie_Restriction';
|
611 |
-
|
612 |
-
/**
|
613 |
-
* @var string Class used for content-type sniffing
|
614 |
-
* @see SimplePie::set_content_type_sniffer_class()
|
615 |
-
* @access private
|
616 |
-
*/
|
617 |
var $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer';
|
618 |
-
|
619 |
-
/**
|
620 |
-
* @var string Class used for item sources.
|
621 |
-
* @see SimplePie::set_source_class()
|
622 |
-
* @access private
|
623 |
-
*/
|
624 |
var $source_class = 'SimplePie_Source';
|
625 |
-
|
626 |
-
/**
|
627 |
-
* @var mixed Set javascript query string parameter (false, or
|
628 |
-
* anything type-cast to false, disables this feature)
|
629 |
-
* @see SimplePie::set_javascript()
|
630 |
-
* @access private
|
631 |
-
*/
|
632 |
var $javascript = 'js';
|
633 |
-
|
634 |
-
/**
|
635 |
-
* @var int Maximum number of feeds to check with autodiscovery
|
636 |
-
* @see SimplePie::set_max_checked_feeds()
|
637 |
-
* @access private
|
638 |
-
*/
|
639 |
var $max_checked_feeds = 10;
|
640 |
-
|
641 |
-
|
642 |
-
* @var string Web-accessible path to the handler_favicon.php file.
|
643 |
-
* @see SimplePie::set_favicon_handler()
|
644 |
-
* @access private
|
645 |
-
*/
|
646 |
-
var $favicon_handler = '';
|
647 |
-
|
648 |
-
/**
|
649 |
-
* @var string Web-accessible path to the handler_image.php file.
|
650 |
-
* @see SimplePie::set_image_handler()
|
651 |
-
* @access private
|
652 |
-
*/
|
653 |
-
var $image_handler = '';
|
654 |
-
|
655 |
-
/**
|
656 |
-
* @var array Stores the URLs when multiple feeds are being initialized.
|
657 |
-
* @see SimplePie::set_feed_url()
|
658 |
-
* @access private
|
659 |
-
*/
|
660 |
var $multifeed_url = array();
|
661 |
-
|
662 |
-
/**
|
663 |
-
* @var array Stores SimplePie objects when multiple feeds initialized.
|
664 |
-
* @access private
|
665 |
-
*/
|
666 |
var $multifeed_objects = array();
|
667 |
-
|
668 |
-
/**
|
669 |
-
* @var array Stores the get_object_vars() array for use with multifeeds.
|
670 |
-
* @see SimplePie::set_feed_url()
|
671 |
-
* @access private
|
672 |
-
*/
|
673 |
var $config_settings = null;
|
674 |
-
|
675 |
-
/**
|
676 |
-
* @var integer Stores the number of items to return per-feed with multifeeds.
|
677 |
-
* @see SimplePie::set_item_limit()
|
678 |
-
* @access private
|
679 |
-
*/
|
680 |
var $item_limit = 0;
|
681 |
-
|
682 |
-
/**
|
683 |
-
* @var array Stores the default attributes to be stripped by strip_attributes().
|
684 |
-
* @see SimplePie::strip_attributes()
|
685 |
-
* @access private
|
686 |
-
*/
|
687 |
var $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc');
|
688 |
-
|
689 |
-
/**
|
690 |
-
* @var array Stores the default tags to be stripped by strip_htmltags().
|
691 |
-
* @see SimplePie::strip_htmltags()
|
692 |
-
* @access private
|
693 |
-
*/
|
694 |
var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
|
695 |
-
|
696 |
-
/**
|
697 |
-
* The SimplePie class contains feed level data and options
|
698 |
-
*
|
699 |
-
* There are two ways that you can create a new SimplePie object. The first
|
700 |
-
* is by passing a feed URL as a parameter to the SimplePie constructor
|
701 |
-
* (as well as optionally setting the cache location and cache expiry). This
|
702 |
-
* will initialise the whole feed with all of the default settings, and you
|
703 |
-
* can begin accessing methods and properties immediately.
|
704 |
-
*
|
705 |
-
* The second way is to create the SimplePie object with no parameters
|
706 |
-
* at all. This will enable you to set configuration options. After setting
|
707 |
-
* them, you must initialise the feed using $feed->init(). At that point the
|
708 |
-
* object's methods and properties will be available to you. This format is
|
709 |
-
* what is used throughout this documentation.
|
710 |
-
*
|
711 |
-
* @access public
|
712 |
-
* @since 1.0 Preview Release
|
713 |
-
* @param string $feed_url This is the URL you want to parse.
|
714 |
-
* @param string $cache_location This is where you want the cache to be stored.
|
715 |
-
* @param int $cache_duration This is the number of seconds that you want to store the cache file for.
|
716 |
-
*/
|
717 |
function SimplePie($feed_url = null, $cache_location = null, $cache_duration = null)
|
718 |
{
|
719 |
-
// Other objects, instances created here so we can set options on them
|
720 |
$this->sanitize =& new SimplePie_Sanitize;
|
721 |
-
|
722 |
-
// Set options if they're passed to the constructor
|
723 |
if ($cache_location !== null)
|
724 |
{
|
725 |
$this->set_cache_location($cache_location);
|
726 |
}
|
727 |
-
|
728 |
if ($cache_duration !== null)
|
729 |
{
|
730 |
$this->set_cache_duration($cache_duration);
|
731 |
}
|
732 |
-
|
733 |
-
// Only init the script if we're passed a feed URL
|
734 |
if ($feed_url !== null)
|
735 |
{
|
736 |
$this->set_feed_url($feed_url);
|
737 |
$this->init();
|
738 |
}
|
739 |
}
|
740 |
-
|
741 |
-
/**
|
742 |
-
* Used for converting object to a string
|
743 |
-
*/
|
744 |
function __toString()
|
745 |
{
|
746 |
return md5(serialize($this->data));
|
747 |
}
|
748 |
-
|
749 |
-
/**
|
750 |
-
* Remove items that link back to this before destroying this object
|
751 |
-
*/
|
752 |
function __destruct()
|
753 |
{
|
754 |
if (!empty($this->data['items']))
|
@@ -768,36 +149,10 @@ class SimplePie
|
|
768 |
unset($this->data['ordered_items']);
|
769 |
}
|
770 |
}
|
771 |
-
|
772 |
-
/**
|
773 |
-
* Force the given data/URL to be treated as a feed no matter what it
|
774 |
-
* appears like
|
775 |
-
*
|
776 |
-
* @access public
|
777 |
-
* @since 1.1
|
778 |
-
* @param bool $enable Force the given data/URL to be treated as a feed
|
779 |
-
*/
|
780 |
function force_feed($enable = false)
|
781 |
{
|
782 |
$this->force_feed = (bool) $enable;
|
783 |
}
|
784 |
-
|
785 |
-
/**
|
786 |
-
* This is the URL of the feed you want to parse.
|
787 |
-
*
|
788 |
-
* This allows you to enter the URL of the feed you want to parse, or the
|
789 |
-
* website you want to try to use auto-discovery on. This takes priority
|
790 |
-
* over any set raw data.
|
791 |
-
*
|
792 |
-
* You can set multiple feeds to mash together by passing an array instead
|
793 |
-
* of a string for the $url. Remember that with each additional feed comes
|
794 |
-
* additional processing and resources.
|
795 |
-
*
|
796 |
-
* @access public
|
797 |
-
* @since 1.0 Preview Release
|
798 |
-
* @param mixed $url This is the URL (or array of URLs) that you want to parse.
|
799 |
-
* @see SimplePie::set_raw_data()
|
800 |
-
*/
|
801 |
function set_feed_url($url)
|
802 |
{
|
803 |
if (is_array($url))
|
@@ -813,14 +168,6 @@ class SimplePie
|
|
813 |
$this->feed_url = SimplePie_Misc::fix_protocol($url, 1);
|
814 |
}
|
815 |
}
|
816 |
-
|
817 |
-
/**
|
818 |
-
* Provides an instance of SimplePie_File to use as a feed
|
819 |
-
*
|
820 |
-
* @access public
|
821 |
-
* @param object &$file Instance of SimplePie_File (or subclass)
|
822 |
-
* @return bool True on success, false on failure
|
823 |
-
*/
|
824 |
function set_file(&$file)
|
825 |
{
|
826 |
if (is_a($file, 'SimplePie_File'))
|
@@ -831,139 +178,42 @@ class SimplePie
|
|
831 |
}
|
832 |
return false;
|
833 |
}
|
834 |
-
|
835 |
-
/**
|
836 |
-
* Allows you to use a string of RSS/Atom data instead of a remote feed.
|
837 |
-
*
|
838 |
-
* If you have a feed available as a string in PHP, you can tell SimplePie
|
839 |
-
* to parse that data string instead of a remote feed. Any set feed URL
|
840 |
-
* takes precedence.
|
841 |
-
*
|
842 |
-
* @access public
|
843 |
-
* @since 1.0 Beta 3
|
844 |
-
* @param string $data RSS or Atom data as a string.
|
845 |
-
* @see SimplePie::set_feed_url()
|
846 |
-
*/
|
847 |
function set_raw_data($data)
|
848 |
{
|
849 |
$this->raw_data = $data;
|
850 |
}
|
851 |
-
|
852 |
-
/**
|
853 |
-
* Allows you to override the default timeout for fetching remote feeds.
|
854 |
-
*
|
855 |
-
* This allows you to change the maximum time the feed's server to respond
|
856 |
-
* and send the feed back.
|
857 |
-
*
|
858 |
-
* @access public
|
859 |
-
* @since 1.0 Beta 3
|
860 |
-
* @param int $timeout The maximum number of seconds to spend waiting to retrieve a feed.
|
861 |
-
*/
|
862 |
function set_timeout($timeout = 10)
|
863 |
{
|
864 |
$this->timeout = (int) $timeout;
|
865 |
}
|
866 |
-
|
867 |
-
/**
|
868 |
-
* Forces SimplePie to use fsockopen() instead of the preferred cURL
|
869 |
-
* functions.
|
870 |
-
*
|
871 |
-
* @access public
|
872 |
-
* @since 1.0 Beta 3
|
873 |
-
* @param bool $enable Force fsockopen() to be used
|
874 |
-
*/
|
875 |
function force_fsockopen($enable = false)
|
876 |
{
|
877 |
$this->force_fsockopen = (bool) $enable;
|
878 |
}
|
879 |
-
|
880 |
-
/**
|
881 |
-
* Outputs the raw XML content of the feed, after it has gone through
|
882 |
-
* SimplePie's filters.
|
883 |
-
*
|
884 |
-
* Used only for debugging, this function will output the XML content as
|
885 |
-
* text/xml. When SimplePie reads in a feed, it does a bit of cleaning up
|
886 |
-
* before trying to parse it. Many parts of the feed are re-written in
|
887 |
-
* memory, and in the end, you have a parsable feed. XML dump shows you the
|
888 |
-
* actual XML that SimplePie tries to parse, which may or may not be very
|
889 |
-
* different from the original feed.
|
890 |
-
*
|
891 |
-
* @access public
|
892 |
-
* @since 1.0 Preview Release
|
893 |
-
* @param bool $enable Enable XML dump
|
894 |
-
*/
|
895 |
function enable_xml_dump($enable = false)
|
896 |
{
|
897 |
$this->xml_dump = (bool) $enable;
|
898 |
}
|
899 |
-
|
900 |
-
/**
|
901 |
-
* Enables/disables caching in SimplePie.
|
902 |
-
*
|
903 |
-
* This option allows you to disable caching all-together in SimplePie.
|
904 |
-
* However, disabling the cache can lead to longer load times.
|
905 |
-
*
|
906 |
-
* @access public
|
907 |
-
* @since 1.0 Preview Release
|
908 |
-
* @param bool $enable Enable caching
|
909 |
-
*/
|
910 |
function enable_cache($enable = true)
|
911 |
{
|
912 |
$this->cache = (bool) $enable;
|
913 |
}
|
914 |
-
|
915 |
-
/**
|
916 |
-
* Set the length of time (in seconds) that the contents of a feed
|
917 |
-
* will be cached.
|
918 |
-
*
|
919 |
-
* @access public
|
920 |
-
* @param int $seconds The feed content cache duration.
|
921 |
-
*/
|
922 |
function set_cache_duration($seconds = 3600)
|
923 |
{
|
924 |
$this->cache_duration = (int) $seconds;
|
925 |
}
|
926 |
-
|
927 |
-
/**
|
928 |
-
* Set the length of time (in seconds) that the autodiscovered feed
|
929 |
-
* URL will be cached.
|
930 |
-
*
|
931 |
-
* @access public
|
932 |
-
* @param int $seconds The autodiscovered feed URL cache duration.
|
933 |
-
*/
|
934 |
function set_autodiscovery_cache_duration($seconds = 604800)
|
935 |
{
|
936 |
$this->autodiscovery_cache_duration = (int) $seconds;
|
937 |
}
|
938 |
-
|
939 |
-
/**
|
940 |
-
* Set the file system location where the cached files should be stored.
|
941 |
-
*
|
942 |
-
* @access public
|
943 |
-
* @param string $location The file system location.
|
944 |
-
*/
|
945 |
function set_cache_location($location = './cache')
|
946 |
{
|
947 |
$this->cache_location = (string) $location;
|
948 |
}
|
949 |
-
|
950 |
-
/**
|
951 |
-
* Determines whether feed items should be sorted into reverse chronological order.
|
952 |
-
*
|
953 |
-
* @access public
|
954 |
-
* @param bool $enable Sort as reverse chronological order.
|
955 |
-
*/
|
956 |
function enable_order_by_date($enable = true)
|
957 |
{
|
958 |
$this->order_by_date = (bool) $enable;
|
959 |
}
|
960 |
-
|
961 |
-
/**
|
962 |
-
* Allows you to override the character encoding reported by the feed.
|
963 |
-
*
|
964 |
-
* @access public
|
965 |
-
* @param string $encoding Character encoding.
|
966 |
-
*/
|
967 |
function set_input_encoding($encoding = false)
|
968 |
{
|
969 |
if ($encoding)
|
@@ -975,35 +225,10 @@ class SimplePie
|
|
975 |
$this->input_encoding = false;
|
976 |
}
|
977 |
}
|
978 |
-
|
979 |
-
/**
|
980 |
-
* Set how much feed autodiscovery to do
|
981 |
-
*
|
982 |
-
* @access public
|
983 |
-
* @see SIMPLEPIE_LOCATOR_NONE
|
984 |
-
* @see SIMPLEPIE_LOCATOR_AUTODISCOVERY
|
985 |
-
* @see SIMPLEPIE_LOCATOR_LOCAL_EXTENSION
|
986 |
-
* @see SIMPLEPIE_LOCATOR_LOCAL_BODY
|
987 |
-
* @see SIMPLEPIE_LOCATOR_REMOTE_EXTENSION
|
988 |
-
* @see SIMPLEPIE_LOCATOR_REMOTE_BODY
|
989 |
-
* @see SIMPLEPIE_LOCATOR_ALL
|
990 |
-
* @param int $level Feed Autodiscovery Level (level can be a
|
991 |
-
* combination of the above constants, see bitwise OR operator)
|
992 |
-
*/
|
993 |
function set_autodiscovery_level($level = SIMPLEPIE_LOCATOR_ALL)
|
994 |
{
|
995 |
$this->autodiscovery = (int) $level;
|
996 |
}
|
997 |
-
|
998 |
-
/**
|
999 |
-
* Allows you to change which class SimplePie uses for caching.
|
1000 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1001 |
-
*
|
1002 |
-
* @access public
|
1003 |
-
* @param string $class Name of custom class.
|
1004 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1005 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1006 |
-
*/
|
1007 |
function set_cache_class($class = 'SimplePie_Cache')
|
1008 |
{
|
1009 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Cache'))
|
@@ -1013,16 +238,6 @@ class SimplePie
|
|
1013 |
}
|
1014 |
return false;
|
1015 |
}
|
1016 |
-
|
1017 |
-
/**
|
1018 |
-
* Allows you to change which class SimplePie uses for auto-discovery.
|
1019 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1020 |
-
*
|
1021 |
-
* @access public
|
1022 |
-
* @param string $class Name of custom class.
|
1023 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1024 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1025 |
-
*/
|
1026 |
function set_locator_class($class = 'SimplePie_Locator')
|
1027 |
{
|
1028 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Locator'))
|
@@ -1032,16 +247,6 @@ class SimplePie
|
|
1032 |
}
|
1033 |
return false;
|
1034 |
}
|
1035 |
-
|
1036 |
-
/**
|
1037 |
-
* Allows you to change which class SimplePie uses for XML parsing.
|
1038 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1039 |
-
*
|
1040 |
-
* @access public
|
1041 |
-
* @param string $class Name of custom class.
|
1042 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1043 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1044 |
-
*/
|
1045 |
function set_parser_class($class = 'SimplePie_Parser')
|
1046 |
{
|
1047 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Parser'))
|
@@ -1051,16 +256,6 @@ class SimplePie
|
|
1051 |
}
|
1052 |
return false;
|
1053 |
}
|
1054 |
-
|
1055 |
-
/**
|
1056 |
-
* Allows you to change which class SimplePie uses for remote file fetching.
|
1057 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1058 |
-
*
|
1059 |
-
* @access public
|
1060 |
-
* @param string $class Name of custom class.
|
1061 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1062 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1063 |
-
*/
|
1064 |
function set_file_class($class = 'SimplePie_File')
|
1065 |
{
|
1066 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_File'))
|
@@ -1070,16 +265,6 @@ class SimplePie
|
|
1070 |
}
|
1071 |
return false;
|
1072 |
}
|
1073 |
-
|
1074 |
-
/**
|
1075 |
-
* Allows you to change which class SimplePie uses for data sanitization.
|
1076 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1077 |
-
*
|
1078 |
-
* @access public
|
1079 |
-
* @param string $class Name of custom class.
|
1080 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1081 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1082 |
-
*/
|
1083 |
function set_sanitize_class($class = 'SimplePie_Sanitize')
|
1084 |
{
|
1085 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Sanitize'))
|
@@ -1089,16 +274,6 @@ class SimplePie
|
|
1089 |
}
|
1090 |
return false;
|
1091 |
}
|
1092 |
-
|
1093 |
-
/**
|
1094 |
-
* Allows you to change which class SimplePie uses for handling feed items.
|
1095 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1096 |
-
*
|
1097 |
-
* @access public
|
1098 |
-
* @param string $class Name of custom class.
|
1099 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1100 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1101 |
-
*/
|
1102 |
function set_item_class($class = 'SimplePie_Item')
|
1103 |
{
|
1104 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Item'))
|
@@ -1108,16 +283,6 @@ class SimplePie
|
|
1108 |
}
|
1109 |
return false;
|
1110 |
}
|
1111 |
-
|
1112 |
-
/**
|
1113 |
-
* Allows you to change which class SimplePie uses for handling author data.
|
1114 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1115 |
-
*
|
1116 |
-
* @access public
|
1117 |
-
* @param string $class Name of custom class.
|
1118 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1119 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1120 |
-
*/
|
1121 |
function set_author_class($class = 'SimplePie_Author')
|
1122 |
{
|
1123 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Author'))
|
@@ -1127,16 +292,6 @@ class SimplePie
|
|
1127 |
}
|
1128 |
return false;
|
1129 |
}
|
1130 |
-
|
1131 |
-
/**
|
1132 |
-
* Allows you to change which class SimplePie uses for handling category data.
|
1133 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1134 |
-
*
|
1135 |
-
* @access public
|
1136 |
-
* @param string $class Name of custom class.
|
1137 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1138 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1139 |
-
*/
|
1140 |
function set_category_class($class = 'SimplePie_Category')
|
1141 |
{
|
1142 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Category'))
|
@@ -1146,16 +301,6 @@ class SimplePie
|
|
1146 |
}
|
1147 |
return false;
|
1148 |
}
|
1149 |
-
|
1150 |
-
/**
|
1151 |
-
* Allows you to change which class SimplePie uses for feed enclosures.
|
1152 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1153 |
-
*
|
1154 |
-
* @access public
|
1155 |
-
* @param string $class Name of custom class.
|
1156 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1157 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1158 |
-
*/
|
1159 |
function set_enclosure_class($class = 'SimplePie_Enclosure')
|
1160 |
{
|
1161 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Enclosure'))
|
@@ -1165,16 +310,6 @@ class SimplePie
|
|
1165 |
}
|
1166 |
return false;
|
1167 |
}
|
1168 |
-
|
1169 |
-
/**
|
1170 |
-
* Allows you to change which class SimplePie uses for <media:text> captions
|
1171 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1172 |
-
*
|
1173 |
-
* @access public
|
1174 |
-
* @param string $class Name of custom class.
|
1175 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1176 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1177 |
-
*/
|
1178 |
function set_caption_class($class = 'SimplePie_Caption')
|
1179 |
{
|
1180 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Caption'))
|
@@ -1184,16 +319,6 @@ class SimplePie
|
|
1184 |
}
|
1185 |
return false;
|
1186 |
}
|
1187 |
-
|
1188 |
-
/**
|
1189 |
-
* Allows you to change which class SimplePie uses for <media:copyright>
|
1190 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1191 |
-
*
|
1192 |
-
* @access public
|
1193 |
-
* @param string $class Name of custom class.
|
1194 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1195 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1196 |
-
*/
|
1197 |
function set_copyright_class($class = 'SimplePie_Copyright')
|
1198 |
{
|
1199 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Copyright'))
|
@@ -1203,16 +328,6 @@ class SimplePie
|
|
1203 |
}
|
1204 |
return false;
|
1205 |
}
|
1206 |
-
|
1207 |
-
/**
|
1208 |
-
* Allows you to change which class SimplePie uses for <media:credit>
|
1209 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1210 |
-
*
|
1211 |
-
* @access public
|
1212 |
-
* @param string $class Name of custom class.
|
1213 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1214 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1215 |
-
*/
|
1216 |
function set_credit_class($class = 'SimplePie_Credit')
|
1217 |
{
|
1218 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Credit'))
|
@@ -1222,16 +337,6 @@ class SimplePie
|
|
1222 |
}
|
1223 |
return false;
|
1224 |
}
|
1225 |
-
|
1226 |
-
/**
|
1227 |
-
* Allows you to change which class SimplePie uses for <media:rating>
|
1228 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1229 |
-
*
|
1230 |
-
* @access public
|
1231 |
-
* @param string $class Name of custom class.
|
1232 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1233 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1234 |
-
*/
|
1235 |
function set_rating_class($class = 'SimplePie_Rating')
|
1236 |
{
|
1237 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Rating'))
|
@@ -1241,16 +346,6 @@ class SimplePie
|
|
1241 |
}
|
1242 |
return false;
|
1243 |
}
|
1244 |
-
|
1245 |
-
/**
|
1246 |
-
* Allows you to change which class SimplePie uses for <media:restriction>
|
1247 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1248 |
-
*
|
1249 |
-
* @access public
|
1250 |
-
* @param string $class Name of custom class.
|
1251 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1252 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1253 |
-
*/
|
1254 |
function set_restriction_class($class = 'SimplePie_Restriction')
|
1255 |
{
|
1256 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Restriction'))
|
@@ -1260,16 +355,6 @@ class SimplePie
|
|
1260 |
}
|
1261 |
return false;
|
1262 |
}
|
1263 |
-
|
1264 |
-
/**
|
1265 |
-
* Allows you to change which class SimplePie uses for content-type sniffing.
|
1266 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1267 |
-
*
|
1268 |
-
* @access public
|
1269 |
-
* @param string $class Name of custom class.
|
1270 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1271 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1272 |
-
*/
|
1273 |
function set_content_type_sniffer_class($class = 'SimplePie_Content_Type_Sniffer')
|
1274 |
{
|
1275 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Content_Type_Sniffer'))
|
@@ -1279,16 +364,6 @@ class SimplePie
|
|
1279 |
}
|
1280 |
return false;
|
1281 |
}
|
1282 |
-
|
1283 |
-
/**
|
1284 |
-
* Allows you to change which class SimplePie uses item sources.
|
1285 |
-
* Useful when you are overloading or extending SimplePie's default classes.
|
1286 |
-
*
|
1287 |
-
* @access public
|
1288 |
-
* @param string $class Name of custom class.
|
1289 |
-
* @link http://php.net/manual/en/keyword.extends.php PHP4 extends documentation
|
1290 |
-
* @link http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.extends PHP5 extends documentation
|
1291 |
-
*/
|
1292 |
function set_source_class($class = 'SimplePie_Source')
|
1293 |
{
|
1294 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Source'))
|
@@ -1298,24 +373,10 @@ class SimplePie
|
|
1298 |
}
|
1299 |
return false;
|
1300 |
}
|
1301 |
-
|
1302 |
-
/**
|
1303 |
-
* Allows you to override the default user agent string.
|
1304 |
-
*
|
1305 |
-
* @access public
|
1306 |
-
* @param string $ua New user agent string.
|
1307 |
-
*/
|
1308 |
function set_useragent($ua = SIMPLEPIE_USERAGENT)
|
1309 |
{
|
1310 |
$this->useragent = (string) $ua;
|
1311 |
}
|
1312 |
-
|
1313 |
-
/**
|
1314 |
-
* Set callback function to create cache filename with
|
1315 |
-
*
|
1316 |
-
* @access public
|
1317 |
-
* @param mixed $function Callback function
|
1318 |
-
*/
|
1319 |
function set_cache_name_function($function = 'md5')
|
1320 |
{
|
1321 |
if (is_callable($function))
|
@@ -1323,13 +384,6 @@ class SimplePie
|
|
1323 |
$this->cache_name_function = $function;
|
1324 |
}
|
1325 |
}
|
1326 |
-
|
1327 |
-
/**
|
1328 |
-
* Set javascript query string parameter
|
1329 |
-
*
|
1330 |
-
* @access public
|
1331 |
-
* @param mixed $get Javascript query string parameter
|
1332 |
-
*/
|
1333 |
function set_javascript($get = 'js')
|
1334 |
{
|
1335 |
if ($get)
|
@@ -1341,14 +395,6 @@ class SimplePie
|
|
1341 |
$this->javascript = false;
|
1342 |
}
|
1343 |
}
|
1344 |
-
|
1345 |
-
/**
|
1346 |
-
* Set options to make SP as fast as possible. Forgoes a
|
1347 |
-
* substantial amount of data sanitization in favor of speed.
|
1348 |
-
*
|
1349 |
-
* @access public
|
1350 |
-
* @param bool $set Whether to set them or not
|
1351 |
-
*/
|
1352 |
function set_stupidly_fast($set = false)
|
1353 |
{
|
1354 |
if ($set)
|
@@ -1361,23 +407,14 @@ class SimplePie
|
|
1361 |
$this->set_image_handler(false);
|
1362 |
}
|
1363 |
}
|
1364 |
-
|
1365 |
-
/**
|
1366 |
-
* Set maximum number of feeds to check with autodiscovery
|
1367 |
-
*
|
1368 |
-
* @access public
|
1369 |
-
* @param int $max Maximum number of feeds to check
|
1370 |
-
*/
|
1371 |
function set_max_checked_feeds($max = 10)
|
1372 |
{
|
1373 |
$this->max_checked_feeds = (int) $max;
|
1374 |
}
|
1375 |
-
|
1376 |
function remove_div($enable = true)
|
1377 |
{
|
1378 |
$this->sanitize->remove_div($enable);
|
1379 |
}
|
1380 |
-
|
1381 |
function strip_htmltags($tags = '', $encode = null)
|
1382 |
{
|
1383 |
if ($tags === '')
|
@@ -1390,12 +427,10 @@ class SimplePie
|
|
1390 |
$this->sanitize->encode_instead_of_strip($tags);
|
1391 |
}
|
1392 |
}
|
1393 |
-
|
1394 |
function encode_instead_of_strip($enable = true)
|
1395 |
{
|
1396 |
$this->sanitize->encode_instead_of_strip($enable);
|
1397 |
}
|
1398 |
-
|
1399 |
function strip_attributes($attribs = '')
|
1400 |
{
|
1401 |
if ($attribs === '')
|
@@ -1404,37 +439,18 @@ class SimplePie
|
|
1404 |
}
|
1405 |
$this->sanitize->strip_attributes($attribs);
|
1406 |
}
|
1407 |
-
|
1408 |
function set_output_encoding($encoding = 'UTF-8')
|
1409 |
{
|
1410 |
$this->sanitize->set_output_encoding($encoding);
|
1411 |
}
|
1412 |
-
|
1413 |
function strip_comments($strip = false)
|
1414 |
{
|
1415 |
$this->sanitize->strip_comments($strip);
|
1416 |
}
|
1417 |
-
|
1418 |
-
/**
|
1419 |
-
* Set element/attribute key/value pairs of HTML attributes
|
1420 |
-
* containing URLs that need to be resolved relative to the feed
|
1421 |
-
*
|
1422 |
-
* @access public
|
1423 |
-
* @since 1.0
|
1424 |
-
* @param array $element_attribute Element/attribute key/value pairs
|
1425 |
-
*/
|
1426 |
function set_url_replacements($element_attribute = array('a' => 'href', 'area' => 'href', 'blockquote' => 'cite', 'del' => 'cite', 'form' => 'action', 'img' => array('longdesc', 'src'), 'input' => 'src', 'ins' => 'cite', 'q' => 'cite'))
|
1427 |
{
|
1428 |
$this->sanitize->set_url_replacements($element_attribute);
|
1429 |
}
|
1430 |
-
|
1431 |
-
/**
|
1432 |
-
* Set the handler to enable the display of cached favicons.
|
1433 |
-
*
|
1434 |
-
* @access public
|
1435 |
-
* @param str $page Web-accessible path to the handler_favicon.php file.
|
1436 |
-
* @param str $qs The query string that the value should be passed to.
|
1437 |
-
*/
|
1438 |
function set_favicon_handler($page = false, $qs = 'i')
|
1439 |
{
|
1440 |
if ($page != false)
|
@@ -1446,14 +462,6 @@ class SimplePie
|
|
1446 |
$this->favicon_handler = '';
|
1447 |
}
|
1448 |
}
|
1449 |
-
|
1450 |
-
/**
|
1451 |
-
* Set the handler to enable the display of cached images.
|
1452 |
-
*
|
1453 |
-
* @access public
|
1454 |
-
* @param str $page Web-accessible path to the handler_image.php file.
|
1455 |
-
* @param str $qs The query string that the value should be passed to.
|
1456 |
-
*/
|
1457 |
function set_image_handler($page = false, $qs = 'i')
|
1458 |
{
|
1459 |
if ($page != false)
|
@@ -1465,18 +473,10 @@ class SimplePie
|
|
1465 |
$this->image_handler = '';
|
1466 |
}
|
1467 |
}
|
1468 |
-
|
1469 |
-
/**
|
1470 |
-
* Set the limit for items returned per-feed with multifeeds.
|
1471 |
-
*
|
1472 |
-
* @access public
|
1473 |
-
* @param integer $limit The maximum number of items to return.
|
1474 |
-
*/
|
1475 |
function set_item_limit($limit = 0)
|
1476 |
{
|
1477 |
$this->item_limit = (int) $limit;
|
1478 |
}
|
1479 |
-
|
1480 |
function init()
|
1481 |
{
|
1482 |
if ((function_exists('version_compare') && version_compare(PHP_VERSION, '4.3.0', '<')) || !extension_loaded('xml') || !extension_loaded('pcre'))
|
@@ -1496,7 +496,6 @@ class SimplePie
|
|
1496 |
function embed_odeo(link) {
|
1497 |
document.writeln('<embed src="http://odeo.com/flash/audio_player_fullsize.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="440" height="80" wmode="transparent" allowScriptAccess="any" flashvars="valid_sample_rate=true&external_url='+link+'"></embed>');
|
1498 |
}
|
1499 |
-
|
1500 |
function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop) {
|
1501 |
if (placeholder != '') {
|
1502 |
document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" href="'+link+'" src="'+placeholder+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="false" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
|
@@ -1505,23 +504,18 @@ function embed_quicktime(type, bgcolor, width, height, link, placeholder, loop)
|
|
1505 |
document.writeln('<embed type="'+type+'" style="cursor:hand; cursor:pointer;" src="'+link+'" width="'+width+'" height="'+height+'" autoplay="false" target="myself" controller="true" loop="'+loop+'" scale="aspect" bgcolor="'+bgcolor+'" pluginspage="http://www.apple.com/quicktime/download/"></embed>');
|
1506 |
}
|
1507 |
}
|
1508 |
-
|
1509 |
function embed_flash(bgcolor, width, height, link, loop, type) {
|
1510 |
document.writeln('<embed src="'+link+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="'+type+'" quality="high" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" loop="'+loop+'"></embed>');
|
1511 |
}
|
1512 |
-
|
1513 |
function embed_flv(width, height, link, placeholder, loop, player) {
|
1514 |
document.writeln('<embed src="'+player+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="high" width="'+width+'" height="'+height+'" wmode="transparent" flashvars="file='+link+'&autostart=false&repeat='+loop+'&showdigits=true&showfsbutton=false"></embed>');
|
1515 |
}
|
1516 |
-
|
1517 |
function embed_wmedia(width, height, link) {
|
1518 |
document.writeln('<embed type="application/x-mplayer2" src="'+link+'" autosize="1" width="'+width+'" height="'+height+'" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"></embed>');
|
1519 |
}
|
1520 |
<?php
|
1521 |
exit;
|
1522 |
}
|
1523 |
-
|
1524 |
-
// Pass whatever was set with config options over to the sanitizer.
|
1525 |
$this->sanitize->pass_cache_data($this->cache, $this->cache_location, $this->cache_name_function, $this->cache_class);
|
1526 |
$this->sanitize->pass_file_data($this->file_class, $this->timeout, $this->useragent, $this->force_fsockopen);
|
1527 |
|
@@ -1534,37 +528,29 @@ function embed_wmedia(width, height, link) {
|
|
1534 |
if ($this->feed_url !== null)
|
1535 |
{
|
1536 |
$parsed_feed_url = SimplePie_Misc::parse_url($this->feed_url);
|
1537 |
-
// Decide whether to enable caching
|
1538 |
if ($this->cache && $parsed_feed_url['scheme'] !== '')
|
1539 |
{
|
1540 |
$cache = call_user_func(array($this->cache_class, 'create'), $this->cache_location, call_user_func($this->cache_name_function, $this->feed_url), 'spc');
|
1541 |
}
|
1542 |
-
// If it's enabled and we don't want an XML dump, use the cache
|
1543 |
if ($cache && !$this->xml_dump)
|
1544 |
{
|
1545 |
-
// Load the Cache
|
1546 |
$this->data = $cache->load();
|
1547 |
if (!empty($this->data))
|
1548 |
{
|
1549 |
-
// If the cache is for an outdated build of SimplePie
|
1550 |
if (!isset($this->data['build']) || $this->data['build'] != SIMPLEPIE_BUILD)
|
1551 |
{
|
1552 |
$cache->unlink();
|
1553 |
$this->data = array();
|
1554 |
}
|
1555 |
-
// If we've hit a collision just rerun it with caching disabled
|
1556 |
elseif (isset($this->data['url']) && $this->data['url'] != $this->feed_url)
|
1557 |
{
|
1558 |
$cache = false;
|
1559 |
$this->data = array();
|
1560 |
}
|
1561 |
-
// If we've got a non feed_url stored (if the page isn't actually a feed, or is a redirect) use that URL.
|
1562 |
elseif (isset($this->data['feed_url']))
|
1563 |
{
|
1564 |
-
// If the autodiscovery cache is still valid use it.
|
1565 |
if ($cache->mtime() + $this->autodiscovery_cache_duration > time())
|
1566 |
{
|
1567 |
-
// Do not need to do feed autodiscovery yet.
|
1568 |
if ($this->data['feed_url'] == $this->data['url'])
|
1569 |
{
|
1570 |
$cache->unlink();
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
define('SIMPLEPIE_NAME', 'SimplePie');
|
|
|
|
|
|
|
|
|
3 |
define('SIMPLEPIE_VERSION', '1.1.3');
|
|
|
|
|
|
|
|
|
4 |
define('SIMPLEPIE_BUILD', 20081219);
|
|
|
|
|
|
|
|
|
5 |
define('SIMPLEPIE_URL', 'http://simplepie.org');
|
|
|
|
|
|
|
|
|
|
|
6 |
define('SIMPLEPIE_USERAGENT', SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION . ' (Feed Parser; ' . SIMPLEPIE_URL . '; Allow like Gecko) Build/' . SIMPLEPIE_BUILD);
|
|
|
|
|
|
|
|
|
7 |
define('SIMPLEPIE_LINKBACK', '<a href="' . SIMPLEPIE_URL . '" title="' . SIMPLEPIE_NAME . ' ' . SIMPLEPIE_VERSION . '">' . SIMPLEPIE_NAME . '</a>');
|
|
|
|
|
|
|
|
|
|
|
8 |
define('SIMPLEPIE_LOCATOR_NONE', 0);
|
|
|
|
|
|
|
|
|
|
|
9 |
define('SIMPLEPIE_LOCATOR_AUTODISCOVERY', 1);
|
|
|
|
|
|
|
|
|
|
|
10 |
define('SIMPLEPIE_LOCATOR_LOCAL_EXTENSION', 2);
|
|
|
|
|
|
|
|
|
|
|
11 |
define('SIMPLEPIE_LOCATOR_LOCAL_BODY', 4);
|
|
|
|
|
|
|
|
|
|
|
12 |
define('SIMPLEPIE_LOCATOR_REMOTE_EXTENSION', 8);
|
|
|
|
|
|
|
|
|
|
|
13 |
define('SIMPLEPIE_LOCATOR_REMOTE_BODY', 16);
|
|
|
|
|
|
|
|
|
|
|
14 |
define('SIMPLEPIE_LOCATOR_ALL', 31);
|
|
|
|
|
|
|
|
|
15 |
define('SIMPLEPIE_TYPE_NONE', 0);
|
|
|
|
|
|
|
|
|
16 |
define('SIMPLEPIE_TYPE_RSS_090', 1);
|
|
|
|
|
|
|
|
|
17 |
define('SIMPLEPIE_TYPE_RSS_091_NETSCAPE', 2);
|
|
|
|
|
|
|
|
|
18 |
define('SIMPLEPIE_TYPE_RSS_091_USERLAND', 4);
|
|
|
|
|
|
|
|
|
19 |
define('SIMPLEPIE_TYPE_RSS_091', 6);
|
|
|
|
|
|
|
|
|
20 |
define('SIMPLEPIE_TYPE_RSS_092', 8);
|
|
|
|
|
|
|
|
|
21 |
define('SIMPLEPIE_TYPE_RSS_093', 16);
|
|
|
|
|
|
|
|
|
22 |
define('SIMPLEPIE_TYPE_RSS_094', 32);
|
|
|
|
|
|
|
|
|
23 |
define('SIMPLEPIE_TYPE_RSS_10', 64);
|
|
|
|
|
|
|
|
|
24 |
define('SIMPLEPIE_TYPE_RSS_20', 128);
|
|
|
|
|
|
|
|
|
25 |
define('SIMPLEPIE_TYPE_RSS_RDF', 65);
|
|
|
|
|
|
|
|
|
26 |
define('SIMPLEPIE_TYPE_RSS_SYNDICATION', 190);
|
|
|
|
|
|
|
|
|
27 |
define('SIMPLEPIE_TYPE_RSS_ALL', 255);
|
|
|
|
|
|
|
|
|
28 |
define('SIMPLEPIE_TYPE_ATOM_03', 256);
|
|
|
|
|
|
|
|
|
29 |
define('SIMPLEPIE_TYPE_ATOM_10', 512);
|
|
|
|
|
|
|
|
|
30 |
define('SIMPLEPIE_TYPE_ATOM_ALL', 768);
|
|
|
|
|
|
|
|
|
31 |
define('SIMPLEPIE_TYPE_ALL', 1023);
|
|
|
|
|
|
|
|
|
32 |
define('SIMPLEPIE_CONSTRUCT_NONE', 0);
|
|
|
|
|
|
|
|
|
33 |
define('SIMPLEPIE_CONSTRUCT_TEXT', 1);
|
|
|
|
|
|
|
|
|
34 |
define('SIMPLEPIE_CONSTRUCT_HTML', 2);
|
|
|
|
|
|
|
|
|
35 |
define('SIMPLEPIE_CONSTRUCT_XHTML', 4);
|
|
|
|
|
|
|
|
|
36 |
define('SIMPLEPIE_CONSTRUCT_BASE64', 8);
|
|
|
|
|
|
|
|
|
37 |
define('SIMPLEPIE_CONSTRUCT_IRI', 16);
|
|
|
|
|
|
|
|
|
38 |
define('SIMPLEPIE_CONSTRUCT_MAYBE_HTML', 32);
|
|
|
|
|
|
|
|
|
39 |
define('SIMPLEPIE_CONSTRUCT_ALL', 63);
|
|
|
|
|
|
|
|
|
40 |
define('SIMPLEPIE_PCRE_HTML_ATTRIBUTE', '((?:[\x09\x0A\x0B\x0C\x0D\x20]+[^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3D\x3E]*(?:[\x09\x0A\x0B\x0C\x0D\x20]*=[\x09\x0A\x0B\x0C\x0D\x20]*(?:"(?:[^"]*)"|\'(?:[^\']*)\'|(?:[^\x09\x0A\x0B\x0C\x0D\x20\x22\x27\x3E][^\x09\x0A\x0B\x0C\x0D\x20\x3E]*)?))?)*)[\x09\x0A\x0B\x0C\x0D\x20]*');
|
|
|
|
|
|
|
|
|
41 |
define('SIMPLEPIE_PCRE_XML_ATTRIBUTE', '((?:\s+(?:(?:[^\s:]+:)?[^\s:]+)\s*=\s*(?:"(?:[^"]*)"|\'(?:[^\']*)\'))*)\s*');
|
|
|
|
|
|
|
|
|
42 |
define('SIMPLEPIE_NAMESPACE_XML', 'http://www.w3.org/XML/1998/namespace');
|
|
|
|
|
|
|
|
|
43 |
define('SIMPLEPIE_NAMESPACE_ATOM_10', 'http://www.w3.org/2005/Atom');
|
|
|
|
|
|
|
|
|
44 |
define('SIMPLEPIE_NAMESPACE_ATOM_03', 'http://purl.org/atom/ns#');
|
|
|
|
|
|
|
|
|
45 |
define('SIMPLEPIE_NAMESPACE_RDF', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
|
|
|
|
|
|
|
|
|
46 |
define('SIMPLEPIE_NAMESPACE_RSS_090', 'http://my.netscape.com/rdf/simple/0.9/');
|
|
|
|
|
|
|
|
|
47 |
define('SIMPLEPIE_NAMESPACE_RSS_10', 'http://purl.org/rss/1.0/');
|
|
|
|
|
|
|
|
|
48 |
define('SIMPLEPIE_NAMESPACE_RSS_10_MODULES_CONTENT', 'http://purl.org/rss/1.0/modules/content/');
|
|
|
|
|
|
|
|
|
|
|
49 |
define('SIMPLEPIE_NAMESPACE_RSS_20', '');
|
|
|
|
|
|
|
|
|
50 |
define('SIMPLEPIE_NAMESPACE_DC_10', 'http://purl.org/dc/elements/1.0/');
|
|
|
|
|
|
|
|
|
51 |
define('SIMPLEPIE_NAMESPACE_DC_11', 'http://purl.org/dc/elements/1.1/');
|
|
|
|
|
|
|
|
|
52 |
define('SIMPLEPIE_NAMESPACE_W3C_BASIC_GEO', 'http://www.w3.org/2003/01/geo/wgs84_pos#');
|
|
|
|
|
|
|
|
|
53 |
define('SIMPLEPIE_NAMESPACE_GEORSS', 'http://www.georss.org/georss');
|
|
|
|
|
|
|
|
|
54 |
define('SIMPLEPIE_NAMESPACE_MEDIARSS', 'http://search.yahoo.com/mrss/');
|
|
|
|
|
|
|
|
|
55 |
define('SIMPLEPIE_NAMESPACE_MEDIARSS_WRONG', 'http://search.yahoo.com/mrss');
|
|
|
|
|
|
|
|
|
56 |
define('SIMPLEPIE_NAMESPACE_ITUNES', 'http://www.itunes.com/dtds/podcast-1.0.dtd');
|
|
|
|
|
|
|
|
|
57 |
define('SIMPLEPIE_NAMESPACE_XHTML', 'http://www.w3.org/1999/xhtml');
|
|
|
|
|
|
|
|
|
58 |
define('SIMPLEPIE_IANA_LINK_RELATIONS_REGISTRY', 'http://www.iana.org/assignments/relation/');
|
|
|
|
|
|
|
|
|
59 |
define('SIMPLEPIE_PHP5', version_compare(PHP_VERSION, '5.0.0', '>='));
|
|
|
|
|
|
|
|
|
60 |
define('SIMPLEPIE_FILE_SOURCE_NONE', 0);
|
|
|
|
|
|
|
|
|
61 |
define('SIMPLEPIE_FILE_SOURCE_REMOTE', 1);
|
|
|
|
|
|
|
|
|
62 |
define('SIMPLEPIE_FILE_SOURCE_LOCAL', 2);
|
|
|
|
|
|
|
|
|
63 |
define('SIMPLEPIE_FILE_SOURCE_FSOCKOPEN', 4);
|
|
|
|
|
|
|
|
|
64 |
define('SIMPLEPIE_FILE_SOURCE_CURL', 8);
|
|
|
|
|
|
|
|
|
65 |
define('SIMPLEPIE_FILE_SOURCE_FILE_GET_CONTENTS', 16);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
class SimplePie
|
67 |
{
|
|
|
|
|
|
|
|
|
68 |
var $data = array();
|
|
|
|
|
|
|
|
|
|
|
69 |
var $error;
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
var $sanitize;
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
var $useragent = SIMPLEPIE_USERAGENT;
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
var $feed_url;
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
var $file;
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
var $raw_data;
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
var $timeout = 10;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
var $force_fsockopen = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
var $force_feed = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
var $xml_dump = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
var $cache = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
var $cache_duration = 3600;
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
var $autodiscovery_cache_duration = 604800; // 7 Days.
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
var $cache_location = './cache';
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
var $cache_name_function = 'md5';
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
var $order_by_date = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
var $input_encoding = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
var $autodiscovery = SIMPLEPIE_LOCATOR_ALL;
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
var $cache_class = 'SimplePie_Cache';
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
var $locator_class = 'SimplePie_Locator';
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
var $parser_class = 'SimplePie_Parser';
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
var $file_class = 'SimplePie_File';
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
var $item_class = 'SimplePie_Item';
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
var $author_class = 'SimplePie_Author';
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
var $category_class = 'SimplePie_Category';
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
var $enclosure_class = 'SimplePie_Enclosure';
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
var $caption_class = 'SimplePie_Caption';
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
var $copyright_class = 'SimplePie_Copyright';
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
var $credit_class = 'SimplePie_Credit';
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
var $rating_class = 'SimplePie_Rating';
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
var $restriction_class = 'SimplePie_Restriction';
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
var $content_type_sniffer_class = 'SimplePie_Content_Type_Sniffer';
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
var $source_class = 'SimplePie_Source';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
var $javascript = 'js';
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
var $max_checked_feeds = 10;
|
104 |
+
var $favicon_handler = '';
|
105 |
+
var $image_handler = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
var $multifeed_url = array();
|
|
|
|
|
|
|
|
|
|
|
107 |
var $multifeed_objects = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
var $config_settings = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
var $item_limit = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
var $strip_attributes = array('bgsound', 'class', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc');
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
var $strip_htmltags = array('base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
function SimplePie($feed_url = null, $cache_location = null, $cache_duration = null)
|
113 |
{
|
|
|
114 |
$this->sanitize =& new SimplePie_Sanitize;
|
|
|
|
|
115 |
if ($cache_location !== null)
|
116 |
{
|
117 |
$this->set_cache_location($cache_location);
|
118 |
}
|
|
|
119 |
if ($cache_duration !== null)
|
120 |
{
|
121 |
$this->set_cache_duration($cache_duration);
|
122 |
}
|
|
|
|
|
123 |
if ($feed_url !== null)
|
124 |
{
|
125 |
$this->set_feed_url($feed_url);
|
126 |
$this->init();
|
127 |
}
|
128 |
}
|
|
|
|
|
|
|
|
|
129 |
function __toString()
|
130 |
{
|
131 |
return md5(serialize($this->data));
|
132 |
}
|
|
|
|
|
|
|
|
|
133 |
function __destruct()
|
134 |
{
|
135 |
if (!empty($this->data['items']))
|
149 |
unset($this->data['ordered_items']);
|
150 |
}
|
151 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
function force_feed($enable = false)
|
153 |
{
|
154 |
$this->force_feed = (bool) $enable;
|
155 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
function set_feed_url($url)
|
157 |
{
|
158 |
if (is_array($url))
|
168 |
$this->feed_url = SimplePie_Misc::fix_protocol($url, 1);
|
169 |
}
|
170 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
function set_file(&$file)
|
172 |
{
|
173 |
if (is_a($file, 'SimplePie_File'))
|
178 |
}
|
179 |
return false;
|
180 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
function set_raw_data($data)
|
182 |
{
|
183 |
$this->raw_data = $data;
|
184 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
function set_timeout($timeout = 10)
|
186 |
{
|
187 |
$this->timeout = (int) $timeout;
|
188 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
function force_fsockopen($enable = false)
|
190 |
{
|
191 |
$this->force_fsockopen = (bool) $enable;
|
192 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
function enable_xml_dump($enable = false)
|
194 |
{
|
195 |
$this->xml_dump = (bool) $enable;
|
196 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
function enable_cache($enable = true)
|
198 |
{
|
199 |
$this->cache = (bool) $enable;
|
200 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
function set_cache_duration($seconds = 3600)
|
202 |
{
|
203 |
$this->cache_duration = (int) $seconds;
|
204 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
function set_autodiscovery_cache_duration($seconds = 604800)
|
206 |
{
|
207 |
$this->autodiscovery_cache_duration = (int) $seconds;
|
208 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
function set_cache_location($location = './cache')
|
210 |
{
|
211 |
$this->cache_location = (string) $location;
|
212 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
function enable_order_by_date($enable = true)
|
214 |
{
|
215 |
$this->order_by_date = (bool) $enable;
|
216 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
function set_input_encoding($encoding = false)
|
218 |
{
|
219 |
if ($encoding)
|
225 |
$this->input_encoding = false;
|
226 |
}
|
227 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
function set_autodiscovery_level($level = SIMPLEPIE_LOCATOR_ALL)
|
229 |
{
|
230 |
$this->autodiscovery = (int) $level;
|
231 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
function set_cache_class($class = 'SimplePie_Cache')
|
233 |
{
|
234 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Cache'))
|
238 |
}
|
239 |
return false;
|
240 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
function set_locator_class($class = 'SimplePie_Locator')
|
242 |
{
|
243 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Locator'))
|
247 |
}
|
248 |
return false;
|
249 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
function set_parser_class($class = 'SimplePie_Parser')
|
251 |
{
|
252 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Parser'))
|
256 |
}
|
257 |
return false;
|
258 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
function set_file_class($class = 'SimplePie_File')
|
260 |
{
|
261 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_File'))
|
265 |
}
|
266 |
return false;
|
267 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
268 |
function set_sanitize_class($class = 'SimplePie_Sanitize')
|
269 |
{
|
270 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Sanitize'))
|
274 |
}
|
275 |
return false;
|
276 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
function set_item_class($class = 'SimplePie_Item')
|
278 |
{
|
279 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Item'))
|
283 |
}
|
284 |
return false;
|
285 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
286 |
function set_author_class($class = 'SimplePie_Author')
|
287 |
{
|
288 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Author'))
|
292 |
}
|
293 |
return false;
|
294 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
function set_category_class($class = 'SimplePie_Category')
|
296 |
{
|
297 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Category'))
|
301 |
}
|
302 |
return false;
|
303 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
function set_enclosure_class($class = 'SimplePie_Enclosure')
|
305 |
{
|
306 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Enclosure'))
|
310 |
}
|
311 |
return false;
|
312 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
313 |
function set_caption_class($class = 'SimplePie_Caption')
|
314 |
{
|
315 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Caption'))
|
319 |
}
|
320 |
return false;
|
321 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
322 |
function set_copyright_class($class = 'SimplePie_Copyright')
|
323 |
{
|
324 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Copyright'))
|
328 |
}
|
329 |
return false;
|
330 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
function set_credit_class($class = 'SimplePie_Credit')
|
332 |
{
|
333 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Credit'))
|
337 |
}
|
338 |
return false;
|
339 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
340 |
function set_rating_class($class = 'SimplePie_Rating')
|
341 |
{
|
342 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Rating'))
|
346 |
}
|
347 |
return false;
|
348 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
function set_restriction_class($class = 'SimplePie_Restriction')
|
350 |
{
|
351 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Restriction'))
|
355 |
}
|
356 |
return false;
|
357 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
function set_content_type_sniffer_class($class = 'SimplePie_Content_Type_Sniffer')
|
359 |
{
|
360 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Content_Type_Sniffer'))
|
364 |
}
|
365 |
return false;
|
366 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
367 |
function set_source_class($class = 'SimplePie_Source')
|
368 |
{
|
369 |
if (SimplePie_Misc::is_subclass_of($class, 'SimplePie_Source'))
|
373 |
}
|
374 |
return false;
|
375 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
function set_useragent($ua = SIMPLEPIE_USERAGENT)
|
377 |
{
|
378 |
$this->useragent = (string) $ua;
|
379 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
380 |
function set_cache_name_function($function = 'md5')
|
381 |
{
|
382 |
if (is_callable($function))
|
384 |
$this->cache_name_function = $function;
|
385 |
}
|
386 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
387 |
function set_javascript($get = 'js')
|
388 |
{
|
389 |
if ($get)
|
395 |
$this->javascript = false;
|
396 |
}
|
397 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
398 |
function set_stupidly_fast($set = false)
|
399 |
{
|
400 |
if ($set)
|
407 |
$this->set_image_handler(false);
|
408 |
}
|
409 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
function set_max_checked_feeds($max = 10)
|
411 |
{
|
412 |
$this->max_checked_feeds = (int) $max;
|
413 |
}
|
|
|
414 |
function remove_div($enable = true)
|
415 |
{
|
416 |
$this->sanitize->remove_div($enable);
|
417 |
}
|
|
|
418 |
function strip_htmltags($tags = '', $encode = null)
|
419 |
{
|
420 |
if ($tags === '')
|
427 |
$this->sanitize->encode_instead_of_strip($tags);
|
428 |
}
|
429 |
}
|
|
|
430 |
function encode_instead_of_strip($enable = true)
|
431 |
{
|
432 |
$this->sanitize->encode_instead_of_strip($enable);
|
433 |
}
|
|
|
434 |
function strip_attributes($attribs = '')
|
435 |
{
|
436 |
if ($attribs === '')
|
439 |
}
|
440 |
$this->sanitize->strip_attributes($attribs);
|
441 |
}
|
|
|
442 |
function set_output_encoding($encoding = 'UTF-8')
|
443 |
{
|
444 |
$this->sanitize->set_output_encoding($encoding);
|
445 |
}
|
|
|
446 |
function strip_comments($strip = false)
|
447 |
{
|
448 |
$this->sanitize->strip_comments($strip);
|
449 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
function set_url_replacements($element_attribute = array('a' => 'href', 'area' => 'href', 'blockquote' => 'cite', 'del' => 'cite', 'form' => 'action', 'img' => array('longdesc', 'src'), 'input' => 'src', 'ins' => 'cite', 'q' => 'cite'))
|
451 |
{
|
452 |
$this->sanitize->set_url_replacements($element_attribute);
|
453 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
454 |
function set_favicon_handler($page = false, $qs = 'i')
|
455 |
{
|
456 |
if ($page != false)
|
462 |
$this->favicon_handler = '';
|
463 |
}
|
464 |
}
|
|
|
|
|
|
|
|
|