summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/View.class.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/View.class.php b/src/lib/View.class.php
index ea5ad60..f0afa39 100644
--- a/src/lib/View.class.php
+++ b/src/lib/View.class.php
@@ -40,8 +40,9 @@ class View {
// Make a list of candidate extensions for this view.
$files = glob(self::filename($view, '*'));
$this->extensions = array();
+ $regex = '@'.preg_quote(VIEWPATH,'@').'[^.]*\.(.*)\.php$@';
foreach ($files as $file) {
- $ext = preg_replace('@[^.]*\.(.*)\.php$@','$1', $file);
+ $ext = preg_replace($regex, '$1', $file);
$this->extensions[] = $ext;
}
if (count($this->extensions)<1) return false;
@@ -77,9 +78,9 @@ class View {
// extension, and the value is how much we like that extension.
// Higher numbers are better.
$prefs = array();
-
+
$accept = new HTTP_Accept($accept_str);
-
+
// Loop through the candidate views, and record how much we
// like each.
foreach ($this->extensions as $ext) {
@@ -92,7 +93,7 @@ class View {
$prefs[$ext] = $quality;
}
}
-
+
// Create an array of all extensions tied for the top quality.
$ret = array();
$top_quality = 0.001;// minimum acceptable according to RFC 2616