summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/Gallery_View.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-07-02 18:00:22 -0700
committerBharat Mediratta <bharat@menalto.com>2009-07-02 18:00:22 -0700
commiteb5538d1357dade9e6e08d1b603033928944011c (patch)
treeee04f9be38a40f4125eafab5367bba6cf1b61164 /modules/gallery/libraries/Gallery_View.php
parent1a5fe42b555d51d22bde1521100a31d2b434486b (diff)
parenta633c134b754305eaa611c5d67af4ca7c79beafe (diff)
Merge branch 'master' of git@github.com:/gallery/gallery3
Conflicts: modules/server_add/controllers/admin_server_add.php
Diffstat (limited to 'modules/gallery/libraries/Gallery_View.php')
-rw-r--r--modules/gallery/libraries/Gallery_View.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php
index 32d79ac3..8a0be7f2 100644
--- a/modules/gallery/libraries/Gallery_View.php
+++ b/modules/gallery/libraries/Gallery_View.php
@@ -72,13 +72,16 @@ class Gallery_View_Core extends View {
*/
protected function combine_files($files, $type) {
$links = array();
- $key = array();
+
+ // Include the url in the cache key so that if the Gallery moves, we don't use old cached
+ // entries.
+ $key = array(url::abs_file(""));
foreach (array_keys($files) as $file) {
$path = DOCROOT . $file;
if (file_exists($path)) {
$stats = stat($path);
- $links[] = $path;
+ $links[$file] = $path;
// 7 == size, 9 == mtime, see http://php.net/stat
$key[] = "$file $stats[7] $stats[9]";
} else {
@@ -92,11 +95,11 @@ class Gallery_View_Core extends View {
if (empty($contents)) {
$contents = "";
- foreach ($links as $link) {
+ foreach ($links as $file => $link) {
if ($type == "css") {
- $contents .= "/* $link */\n" . $this->process_css($link) . "\n";
+ $contents .= "/* $file */\n" . $this->process_css($link) . "\n";
} else {
- $contents .= "/* $link */\n" . file_get_contents($link) . "\n";
+ $contents .= "/* $file */\n" . file_get_contents($link) . "\n";
}
}