summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/css.php3
-rw-r--r--lib/exe/fetch.php6
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index c96dedd37..f273b7ee4 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -456,8 +456,9 @@ class DokuCssFile {
if (defined('DOKU_UNITTEST')) {
$basedir[] = realpath(TMP_DIR);
}
- $regex = '#^('.join('|',$basedir).')#';
+ $basedir = array_map('preg_quote_cb', $basedir);
+ $regex = '/^('.join('|',$basedir).')/';
$this->relative_path = preg_replace($regex, '', dirname($this->filepath));
}
diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php
index 5967494bf..5f82ad0e0 100644
--- a/lib/exe/fetch.php
+++ b/lib/exe/fetch.php
@@ -78,8 +78,8 @@ if (defined('SIMPLE_TEST')) {
unset($evt);
//handle image resizing/cropping
- if((substr($MIME, 0, 5) == 'image') && $WIDTH) {
- if($HEIGHT) {
+ if((substr($MIME, 0, 5) == 'image') && ($WIDTH || $HEIGHT)) {
+ if($HEIGHT && $WDITH) {
$data['file'] = $FILE = media_crop_image($data['file'], $EXT, $WIDTH, $HEIGHT);
} else {
$data['file'] = $FILE = media_resize_image($data['file'], $EXT, $WIDTH, $HEIGHT);
@@ -89,7 +89,7 @@ if (defined('SIMPLE_TEST')) {
// finally send the file to the client
$evt = new Doku_Event('MEDIA_SENDFILE', $data);
if($evt->advise_before()) {
- sendFile($data['file'], $data['mime'], $data['download'], $data['cache'], $data['ispublic']);
+ sendFile($data['file'], $data['mime'], $data['download'], $data['cache'], $data['ispublic'], $data['orig']);
}
// Do something after the download finished.
$evt->advise_after(); // will not be emitted on 304 or x-sendfile