Change gallery::find_file to not assume that the absolute path is relative to the document root. Instead ignore all th path parts until one of application, modules, themes, or libs is found. Fixes ticket #827

This commit is contained in:
Tim Almdal
2009-10-01 12:43:30 -07:00
parent 3ceb2775f8
commit b2a9bf43af
2 changed files with 14 additions and 5 deletions

View File

@@ -85,13 +85,11 @@ class Gallery_View_Core extends View {
if (empty($contents)) {
$contents = "";
$docroot_len = strlen(DOCROOT);
foreach (array_keys($paths) as $path) {
$relative = substr($path, $docroot_len);
if ($type == "css") {
$contents .= "/* $relative */\n" . $this->process_css($path) . "\n";
$contents .= "/* $path */\n" . $this->process_css($path) . "\n";
} else {
$contents .= "/* $relative */\n" . file_get_contents($path) . "\n";
$contents .= "/* $path */\n" . file_get_contents($path) . "\n";
}
}