diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-09-28 13:46:04 +0200 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-09-28 13:46:04 +0200 |
commit | b79379f2e598abaa2febb299cdfcebe0a95d034c (patch) | |
tree | 7098c3a758f606394f4b38d679b5198f8973cffe /lib/exe | |
parent | 73411587cb6d2c54aefebe90c87799c4aa1d31ec (diff) | |
parent | da9572711f54d13ce3c5506971154b0bc359723f (diff) | |
download | rpg-b79379f2e598abaa2febb299cdfcebe0a95d034c.tar.gz rpg-b79379f2e598abaa2febb299cdfcebe0a95d034c.tar.bz2 |
Merge remote-tracking branch 'origin/master' into overridablelangstrings
Conflicts:
inc/plugin.php
Diffstat (limited to 'lib/exe')
-rw-r--r-- | lib/exe/ajax.php | 2 | ||||
-rw-r--r-- | lib/exe/css.php | 31 | ||||
-rw-r--r-- | lib/exe/mediamanager.php | 1 |
3 files changed, 26 insertions, 8 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/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); |