From 28db35ad3dd974cc2f627d25f7bcc16e9fd0ceac Mon Sep 17 00:00:00 2001 From: dploeger Date: Mon, 28 Nov 2011 11:43:41 +0100 Subject: Fixes SYMPTOMS of FS #2393 --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index 9d3e90a54..db975380f 100644 --- a/inc/media.php +++ b/inc/media.php @@ -108,7 +108,7 @@ function media_metaform($id,$auth){ $src = mediaFN($id); // output - $form = new Doku_Form(array('action' => media_managerURL(array('tab_details' => 'view')), + $form = new Doku_Form(array('action' => media_managerURL(array('tab_details' => 'view'), '&'), 'class' => 'meta')); $form->addHidden('img', $id); $form->addHidden('mediado', 'save'); -- cgit v1.2.3 From 3543c6de939c52517f590300b6d4289dc3a785ff Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 28 Nov 2011 20:29:39 +0100 Subject: deprecated 3rd parameter of cleanID() FS#2377 For some reason trailing/leading underscores were allowed when uploading files. But the rest of the code (eg. listing or downloading files) never supported this. This patch removes this special case for uploading files to streamline ID cleaning of pages and media files. --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index 9d3e90a54..07351e48b 100644 --- a/inc/media.php +++ b/inc/media.php @@ -332,7 +332,7 @@ function media_save($file, $id, $ow, $auth, $move) { global $lang, $conf; // get filename - $id = cleanID($id,false,true); + $id = cleanID($id); $fn = mediaFN($id); // get filetype regexp -- cgit v1.2.3 From eea07c2327a7f78bb4f09b10f2b9805a2e6f5459 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 4 Dec 2011 17:56:28 +0000 Subject: fixed link in popup media manager to fullscreen media manager to open in correct namespace (FS#2401) --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index 7fb163ade..e71bfd236 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1364,7 +1364,7 @@ function media_printfile($item,$auth,$jump,$display_namespace=false){ 'alt="'.$lang['mediaview'].'" title="'.$lang['mediaview'].'" class="btn" />'; // mediamanager button - $link = wl('',array('do'=>'media','image'=>$item['id'])); + $link = wl('',array('do'=>'media','image'=>$item['id'],'ns'=>getNS($item['id']))); echo ' '; -- cgit v1.2.3 From 2e0ce43774bc165c88e07cd1eab502a22ebfa2ae Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 13 Dec 2011 15:18:29 +0100 Subject: Avoid a warning when a media cachefile doesn't exist yet --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index e71bfd236..93692a7c6 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1778,7 +1778,7 @@ function media_crop_image($file, $ext, $w, $h=0){ $local = getCacheName($file,'.media.'.$cw.'x'.$ch.'.crop.'.$ext); $mtime = @filemtime($local); // 0 if not exists - if( $mtime > filemtime($file) || + if( $mtime > @filemtime($file) || media_crop_imageIM($ext,$file,$info[0],$info[1],$local,$cw,$ch,$cx,$cy) || media_resize_imageGD($ext,$file,$cw,$ch,$local,$cw,$ch,$cx,$cy) ){ if($conf['fperm']) chmod($local, $conf['fperm']); -- cgit v1.2.3 From 370d3435fb6b3a339465bb90b79ea9c275c0cbf9 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Sun, 18 Dec 2011 18:58:27 +0100 Subject: Fix double URL-encoding in media manager (FS#2403) --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index 93692a7c6..af4647ecb 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1674,7 +1674,7 @@ function media_nstree_item($item){ $ret = ''; if (!($_REQUEST['do'] == 'media')) $ret .= ''; - else $ret .= ' idfilter($item['id'], false), 'tab_files' => 'files')) .'" class="idx_dir">'; $ret .= $item['label']; $ret .= ''; -- cgit v1.2.3 From 063fb5b5da7db55f0f8532aef9d5eda458d73b71 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 9 Jan 2012 22:28:27 +0100 Subject: do not rely on tmpfile() in the AJAX uploader backend FS#2417 --- inc/media.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index af4647ecb..508869b3b 100644 --- a/inc/media.php +++ b/inc/media.php @@ -230,16 +230,18 @@ function media_upload_xhr($ns,$auth){ $id = $_GET['qqfile']; list($ext,$mime,$dl) = mimetype($id); $input = fopen("php://input", "r"); - $temp = tmpfile(); - $realSize = stream_copy_to_stream($input, $temp); - fclose($input); - if ($realSize != (int)$_SERVER["CONTENT_LENGTH"]) return false; if (!($tmp = io_mktmpdir())) return false; $path = $tmp.'/'.md5($id); $target = fopen($path, "w"); - fseek($temp, 0, SEEK_SET); - stream_copy_to_stream($temp, $target); + $realSize = stream_copy_to_stream($input, $target); fclose($target); + fclose($input); + if ($realSize != (int)$_SERVER["CONTENT_LENGTH"]){ + unlink($target); + unlink($path); + return false; + } + $res = media_save( array('name' => $path, 'mime' => $mime, -- cgit v1.2.3 From 2dba8df4d3a5c3e9d104bee5290766929f4cabee Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Fri, 13 Jan 2012 10:02:32 +0100 Subject: Fix sorting in media manager search (FS#2423) --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index 508869b3b..29c3d0153 100644 --- a/inc/media.php +++ b/inc/media.php @@ -759,7 +759,7 @@ function media_tab_search($ns,$auth=null) { echo ''.NL; -- cgit v1.2.3 From 02eb484f1af2dd64a078b53cb5bcfe2a832022ec Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 12 Jan 2012 17:28:22 +0100 Subject: always show full filename as tooltip in mediamanager --- inc/media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index 29c3d0153..8ff0a7d14 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1352,7 +1352,7 @@ function media_printfile($item,$auth,$jump,$display_namespace=false){ $info .= filesize_h($item['size']); // output - echo '
'.NL; + echo '
'.NL; if (!$display_namespace) { echo ''.hsc($file).' '; } else { @@ -1413,7 +1413,7 @@ function media_printfile_thumbs($item,$auth,$jump=false,$display_namespace=false $file = utf8_decodeFN($item['file']); // output - echo '
  • '.NL; + echo '
  • '.NL; echo '
    '; if($item['isimg']) { -- cgit v1.2.3 From 59f3611b2f11fe1652befff8189787a1181a2f66 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 22 Jan 2012 16:39:01 +0000 Subject: removed 'view original' button from new media manager again (was added in b8a84c03) and made a link around the image instead, as that is a more minor change (as it should be during the RC phase) and is what was originally planned --- inc/media.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index 8ff0a7d14..c53e1f5fc 100644 --- a/inc/media.php +++ b/inc/media.php @@ -832,6 +832,7 @@ function media_preview($image, $auth, $rev=false, $meta=false) { $size = media_image_preview_size($image, $rev, $meta); if ($size) { + global $lang; echo '
    '; $more = array(); @@ -845,7 +846,10 @@ function media_preview($image, $auth, $rev=false, $meta=false) { $more['w'] = $size[0]; $more['h'] = $size[1]; $src = ml($image, $more); + + echo ''; echo ''; + echo ''; echo '
    '.NL; } -- cgit v1.2.3 From c7b28ffda48d3e6e225940a74b00ee5011f45b4b Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sat, 4 Feb 2012 13:26:50 +0000 Subject: added div.table around non-editable content as well (FS#1980) --- inc/media.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index c53e1f5fc..66c531452 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1116,6 +1116,7 @@ function media_file_diff($image, $l_rev, $r_rev, $ns, $auth, $fromajax){ list($l_head, $r_head) = html_diff_head($l_rev, $r_rev, $image, true); ?> +
    @@ -1183,6 +1184,7 @@ function media_file_diff($image, $l_rev, $r_rev, $ns, $auth, $fromajax){ echo ''.NL; echo '
    '.NL; + echo '
    '.NL; if ($is_img && !$fromajax) echo '
  • '; } -- cgit v1.2.3 From 63703ba5bd81f50c43bc45f8bf79c514afa3ee49 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Fri, 16 Mar 2012 12:09:30 +0100 Subject: coding style updates --- inc/media.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index 66c531452..dd0193fa0 100644 --- a/inc/media.php +++ b/inc/media.php @@ -175,10 +175,10 @@ define('DOKU_MEDIA_EMPTY_NS', 8); * * @author Andreas Gohr * @return int One of: 0, - DOKU_MEDIA_DELETED, - DOKU_MEDIA_DELETED | DOKU_MEDIA_EMPTY_NS, - DOKU_MEDIA_NOT_AUTH, - DOKU_MEDIA_INUSE + * DOKU_MEDIA_DELETED, + * DOKU_MEDIA_DELETED | DOKU_MEDIA_EMPTY_NS, + * DOKU_MEDIA_NOT_AUTH, + * DOKU_MEDIA_INUSE */ function media_delete($id,$auth){ global $lang; -- cgit v1.2.3