Lots of fixes.
git-svn-id: http://svn.automattic.com/wordpress/trunk@714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c31ebcf3c0
commit
5781a9f056
|
@ -2,7 +2,7 @@
|
||||||
// Links weblogs.com grabber
|
// Links weblogs.com grabber
|
||||||
// Copyright (C) 2003 Mike Little -- mike@zed1.com
|
// Copyright (C) 2003 Mike Little -- mike@zed1.com
|
||||||
|
|
||||||
require_once('wp-config.php');
|
require_once('../wp-config.php');
|
||||||
|
|
||||||
// globals to hold state
|
// globals to hold state
|
||||||
$updated_timestamp = 0;
|
$updated_timestamp = 0;
|
||||||
|
@ -46,15 +46,15 @@ function update_links() {
|
||||||
** otherwise return false (nothing to do)
|
** otherwise return false (nothing to do)
|
||||||
**/
|
**/
|
||||||
function get_weblogs_updatedfile() {
|
function get_weblogs_updatedfile() {
|
||||||
global $ignore_weblogs_cache,ABSPATH;
|
global $ignore_weblogs_cache;
|
||||||
$update = false;
|
$update = false;
|
||||||
|
$file = ABSPATH . get_settings('weblogs_cache_file');
|
||||||
if ($ignore_weblogs_cache) {
|
if ($ignore_weblogs_cache) {
|
||||||
$update = true;
|
$update = true;
|
||||||
} else {
|
} else {
|
||||||
if (file_exists(get_settings('weblogs_cache_file'))) {
|
if (file_exists($file)) {
|
||||||
// is it old?
|
// is it old?
|
||||||
$modtime = filemtime(get_settings('weblogs_cache_file'));
|
$modtime = filemtime($file);
|
||||||
if ((time() - $modtime) > (get_settings('weblogs_cacheminutes') * 60)) {
|
if ((time() - $modtime) > (get_settings('weblogs_cacheminutes') * 60)) {
|
||||||
$update = true;
|
$update = true;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ function get_weblogs_updatedfile() {
|
||||||
$contents = preg_replace("/'/",''',$contents);
|
$contents = preg_replace("/'/",''',$contents);
|
||||||
$contents = preg_replace('|[^[:space:][:punct:][:alpha:][:digit:]]|','',$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);
|
fwrite($cachefp, $contents);
|
||||||
fclose($cachefp);
|
fclose($cachefp);
|
||||||
} else {
|
} else {
|
||||||
|
@ -119,7 +119,6 @@ function endElement($parser, $tagName) {
|
||||||
** trailing slash
|
** trailing slash
|
||||||
**/
|
**/
|
||||||
function transform_url($url) {
|
function transform_url($url) {
|
||||||
global ABSPATH;
|
|
||||||
//echo("transform_url(): $url ");
|
//echo("transform_url(): $url ");
|
||||||
$url = str_replace('www.', '', $url);
|
$url = str_replace('www.', '', $url);
|
||||||
$url = str_replace('WWW.', '', $url);
|
$url = str_replace('WWW.', '', $url);
|
||||||
|
|
Loading…
Reference in New Issue