From 25581d5c26fb630dad768c82395c73f0e4b8ccf8 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 4 Jul 2010 19:43:29 +0000 Subject: moved cache to data directory for better security --- cache/cache.txt | 1 - permissions.php | 43 ------------------------------ views/default/settings/simplepie/edit.php | 5 ---- views/default/widgets/feed_reader/view.php | 7 +++-- 4 files changed, 5 insertions(+), 51 deletions(-) delete mode 100644 cache/cache.txt delete mode 100644 permissions.php diff --git a/cache/cache.txt b/cache/cache.txt deleted file mode 100644 index c30218d68..000000000 --- a/cache/cache.txt +++ /dev/null @@ -1 +0,0 @@ -This is where feeds are cached. \ No newline at end of file diff --git a/permissions.php b/permissions.php deleted file mode 100644 index 6f06a0268..000000000 --- a/permissions.php +++ /dev/null @@ -1,43 +0,0 @@ - - - - -
- - -
- -Good news. The cache directory is writeable.

'; - else - echo '

The cache directory is not writeable.

'; - - echo '

The permissions on the directory are ' . substr(decoct(fileperms('cache')),2) . '.

'; - -?> -
-
- - diff --git a/views/default/settings/simplepie/edit.php b/views/default/settings/simplepie/edit.php index 4583394c3..d67034aa4 100644 --- a/views/default/settings/simplepie/edit.php +++ b/views/default/settings/simplepie/edit.php @@ -2,14 +2,9 @@ global $CONFIG; $compat_url = $CONFIG->wwwroot . 'mod/simplepie/sp_compatibility_test.php'; -$permit_url = $CONFIG->wwwroot . 'mod/simplepie/permissions.php'; ?>

Compatibility Test

- -

-Permissions Test for Cache -

diff --git a/views/default/widgets/feed_reader/view.php b/views/default/widgets/feed_reader/view.php index 56bf4482d..a8d589f98 100644 --- a/views/default/widgets/feed_reader/view.php +++ b/views/default/widgets/feed_reader/view.php @@ -15,9 +15,12 @@ if ($feed_url) { $num_items = $vars['entity']->num_items; $post_date = $vars['entity']->post_date; - $cache_loc = $CONFIG->pluginspath . '/simplepie/cache'; + $cache_location = $CONFIG->dataroot . '/simplepie_cache/'; + if (!file_exists($cache_location)) { + mkdir($cache_location, 0777); + } - $feed = new SimplePie($feed_url, $cache_loc); + $feed = new SimplePie($feed_url, $cache_location); // doubles timeout if going through a proxy //$feed->set_timeout(20); -- cgit v1.2.3