summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
authorlisps <stummp@loewen.de>2014-09-26 12:48:02 +0200
committerlisps <stummp@loewen.de>2014-09-26 12:48:02 +0200
commit8d39e80d363eda2ef31dac8473bfdab4b9cd7ce5 (patch)
tree7bab1caccbc0de7c30f0e610d1e5ee9b3c67d564 /lib/exe
parent115aab0f5fca76360c50f759f587229ff327105d (diff)
parent7b950f2d59050052c1d9251b0bd9bd40c7441040 (diff)
downloadrpg-8d39e80d363eda2ef31dac8473bfdab4b9cd7ce5.tar.gz
rpg-8d39e80d363eda2ef31dac8473bfdab4b9cd7ce5.tar.bz2
Merge remote-tracking branch master into revisions
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/ajax.php2
-rw-r--r--lib/exe/css.php31
-rw-r--r--lib/exe/js.php5
-rw-r--r--lib/exe/mediamanager.php1
4 files changed, 30 insertions, 9 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php
index 1000094bc..a200a3ded 100644
--- a/lib/exe/ajax.php
+++ b/lib/exe/ajax.php
@@ -254,7 +254,7 @@ function ajax_mediadiff(){
$image = '';
if ($INPUT->has('image')) $image = cleanID($INPUT->str('image'));
- $NS = $INPUT->post->str('ns');
+ $NS = getNS($image);
$auth = auth_quickaclcheck("$NS:*");
media_diff($image, $NS, $auth, true);
}
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/js.php b/lib/exe/js.php
index 4d4660197..bec12ef7a 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -166,7 +166,10 @@ function js_load($file){
// is it a include_once?
if($match[1]){
$base = utf8_basename($ifile);
- if($loaded[$base]) continue;
+ if($loaded[$base]){
+ $data = str_replace($match[0], '' ,$data);
+ continue;
+ }
$loaded[$base] = true;
}
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);