Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions rss_fetch.inc
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ define('MAGPIE_VERSION', '0.80a');

$MAGPIE_ERROR = "";

function fetch_rss ($url) {
function fetch_rss ($url, $cache_age=null) {
// initialize constants
init();

Expand Down Expand Up @@ -114,7 +114,8 @@ function fetch_rss ($url) {
// 3. if cached obj fails freshness check, fetch remote
// 4. if remote fails, return stale object, or error

$cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE );
$cache_age = $cache_age !== null ? $cache_age : MAGPIE_CACHE_AGE;
$cache = new RSSCache( MAGPIE_CACHE_DIR, $cache_age );

if (MAGPIE_DEBUG and $cache->ERROR) {
debug($cache->ERROR, E_USER_WARNING);
Expand Down
6 changes: 3 additions & 3 deletions rss_parse.inc
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ class MagpieRSS {
$el = $element = strtolower($element);
$attrs = array_change_key_case($attrs, CASE_LOWER);

# check for a namespace, and split if found
# check for a namespace, and explode if found
# only if we're not inside a content tag

if ( empty($this->incontent) ) {
$ns = false;

if ( strpos( $element, ':' ) ) {
list($ns, $el) = split( ':', $element, 2);
list($ns, $el) = explode( ':', $element, 2);
}

if ( $ns and $ns != 'rdf' ) {
Expand Down Expand Up @@ -360,7 +360,7 @@ class MagpieRSS {

# Don't get bamboozled by namespace voodoo
if (strpos($el, ':')) {
list($ns, $closer) = split(':', $el);
list($ns, $closer) = explode(':', $el);
}
else {
$ns = false; $closer = $el;
Expand Down