summaryrefslogtreecommitdiff
path: root/src/lib/View.class.php
diff options
context:
space:
mode:
authormckenzierobotics.org <mckenzierobotics.org@zapp.tigertech.net>2011-09-05 14:41:25 -0700
committermckenzierobotics.org <mckenzierobotics.org@zapp.tigertech.net>2011-09-05 14:41:25 -0700
commit6e9d542022d612e5352e4ad4c8bf25bbea530c4a (patch)
tree075f8301e02c4302ca8b8f5c2973351196297319 /src/lib/View.class.php
parentc45cb5499ac6327125689fc81f773436e82ea47a (diff)
Fix a nasty bug in View.class.php when the installation path contains a dot
Diffstat (limited to 'src/lib/View.class.php')
-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