From 5781a9f05623f00db855d5aefd0c144797e41abf Mon Sep 17 00:00:00 2001 From: saxmatt Date: Sun, 4 Jan 2004 07:40:15 +0000 Subject: [PATCH] Lots of fixes. git-svn-id: http://svn.automattic.com/wordpress/trunk@714 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/links-update-xml.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/wp-includes/links-update-xml.php b/wp-includes/links-update-xml.php index 0d059569b..c32c3bed2 100644 --- a/wp-includes/links-update-xml.php +++ b/wp-includes/links-update-xml.php @@ -2,7 +2,7 @@ // Links weblogs.com grabber // Copyright (C) 2003 Mike Little -- mike@zed1.com -require_once('wp-config.php'); +require_once('../wp-config.php'); // globals to hold state $updated_timestamp = 0; @@ -46,15 +46,15 @@ function update_links() { ** otherwise return false (nothing to do) **/ function get_weblogs_updatedfile() { - global $ignore_weblogs_cache,ABSPATH; + global $ignore_weblogs_cache; $update = false; - + $file = ABSPATH . get_settings('weblogs_cache_file'); if ($ignore_weblogs_cache) { $update = true; } else { - if (file_exists(get_settings('weblogs_cache_file'))) { + if (file_exists($file)) { // is it old? - $modtime = filemtime(get_settings('weblogs_cache_file')); + $modtime = filemtime($file); if ((time() - $modtime) > (get_settings('weblogs_cacheminutes') * 60)) { $update = true; } @@ -73,7 +73,7 @@ function get_weblogs_updatedfile() { $contents = preg_replace("/'/",''',$contents); $contents = preg_replace('|[^[:space:][:punct:][:alpha:][:digit:]]|','',$contents); - $cachefp = fopen(get_settings('weblogs_cache_file'), "w"); + $cachefp = fopen(ABSPATH . get_settings('weblogs_cache_file'), "w"); fwrite($cachefp, $contents); fclose($cachefp); } else { @@ -119,7 +119,6 @@ function endElement($parser, $tagName) { ** trailing slash **/ function transform_url($url) { - global ABSPATH; //echo("transform_url(): $url "); $url = str_replace('www.', '', $url); $url = str_replace('WWW.', '', $url); @@ -145,7 +144,7 @@ if (get_weblogs_updatedfile()) { xml_set_element_handler($xml_parser, "startElement", "endElement"); // Open the XML file for reading - $fp = fopen(ABSPATH.get_settings('weblogs_cache_file'), "r") + $fp = fopen(ABSPATH . get_settings('weblogs_cache_file'), "r") or die("Error reading XML data."); // Read the XML file 16KB at a time