summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/css.php31
-rw-r--r--lib/exe/detail.php3
-rw-r--r--lib/exe/mediamanager.php1
3 files changed, 27 insertions, 8 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 30d0d18c5..6c1d60751 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -602,30 +602,47 @@ function css_comment_cb($matches){
function css_onelinecomment_cb($matches) {
$line = $matches[0];
- $out = '';
$i = 0;
$len = strlen($line);
+
while ($i< $len){
$nextcom = strpos($line, '//', $i);
$nexturl = stripos($line, 'url(', $i);
if($nextcom === false) {
// no more comments, we're done
- $out .= substr($line, $i, $len-$i);
+ $i = $len;
break;
}
+
+ // keep any quoted string that starts before a comment
+ $nextsqt = strpos($line, "'", $i);
+ $nextdqt = strpos($line, '"', $i);
+ if(min($nextsqt, $nextdqt) < $nextcom) {
+ $skipto = false;
+ if($nextsqt !== false && ($nextdqt === false || $nextsqt < $nextdqt)) {
+ $skipto = strpos($line, "'", $nextsqt+1) +1;
+ } else if ($nextdqt !== false) {
+ $skipto = strpos($line, '"', $nextdqt+1) +1;
+ }
+
+ if($skipto !== false) {
+ $i = $skipto;
+ continue;
+ }
+ }
+
if($nexturl === false || $nextcom < $nexturl) {
// no url anymore, strip comment and be done
- $out .= substr($line, $i, $nextcom-$i);
+ $i = $nextcom;
break;
}
+
// we have an upcoming url
- $urlclose = strpos($line, ')', $nexturl);
- $out .= substr($line, $i, $urlclose-$i);
- $i = $urlclose;
+ $i = strpos($line, ')', $nexturl);
}
- return $out;
+ return substr($line, 0, $i);
}
//Setup VIM: ex: et ts=4 :
diff --git a/lib/exe/detail.php b/lib/exe/detail.php
index cd3f362ad..cc29d5b87 100644
--- a/lib/exe/detail.php
+++ b/lib/exe/detail.php
@@ -5,6 +5,7 @@ require_once(DOKU_INC.'inc/init.php');
$IMG = getID('media');
$ID = cleanID($INPUT->str('id'));
+$REV = $INPUT->int('rev');
// this makes some general info available as well as the info about the
// "parent" page
@@ -35,7 +36,7 @@ $ERROR = false;
$AUTH = auth_quickaclcheck($IMG);
if($AUTH >= AUTH_READ){
// check if image exists
- $SRC = mediaFN($IMG);
+ $SRC = mediaFN($IMG,$REV);
if(!@file_exists($SRC)){
//doesn't exist!
http_status(404);
diff --git a/lib/exe/mediamanager.php b/lib/exe/mediamanager.php
index 7044232ce..c90b6db35 100644
--- a/lib/exe/mediamanager.php
+++ b/lib/exe/mediamanager.php
@@ -8,6 +8,7 @@
require_once(DOKU_INC.'inc/init.php');
global $INPUT;
+ global $lang;
// handle passed message
if($INPUT->str('msg1')) msg(hsc($INPUT->str('msg1')),1);
if($INPUT->str('err')) msg(hsc($INPUT->str('err')),-1);