aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/elgglib.php
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-13 19:30:44 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-04-13 19:30:44 +0000
commitd87b6ffe7312888d109428e6a939f33394549677 (patch)
treed9211c16c9ac3bb646b0049cc54eda56a11af81c /engine/lib/elgglib.php
parent388d8405bb10b3b2107629f8cd4133bff3a7693c (diff)
downloadelgg-d87b6ffe7312888d109428e6a939f33394549677.tar.gz
elgg-d87b6ffe7312888d109428e6a939f33394549677.tar.bz2
Fixes #3331. Changed cache schema to allow for JS/CSS views with slashes and dots.
git-svn-id: http://code.elgg.org/elgg/trunk@8986 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/elgglib.php')
-rw-r--r--engine/lib/elgglib.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php
index 063e25fc4..a800aca7a 100644
--- a/engine/lib/elgglib.php
+++ b/engine/lib/elgglib.php
@@ -1771,12 +1771,10 @@ function elgg_cacheable_view_page_handler($page, $type) {
// translates to the url /js/calendars/jquery.fullcalendar.min.<ts>.js
// and the view js/calendars/jquery.fullcalendar.min
// we ignore the last two dots for the ts and the ext.
- $last_part = array_pop($page);
- $last_part_bits = explode('.', $last_part);
- $last_part_bits = array_slice($last_part_bits, 0, -2);
- $page[] = implode('.', $last_part_bits);
-
- $view = implode('/', $page);
+ $page = implode('/', $page);
+ $regex = '|(.+)\.([^\.]+)\.([^.]+)$|';
+ preg_match($regex, $page, $matches);
+ $view = $matches[1];
$return = elgg_view("$type/$view");
header("Content-type: $content_type");