From bb814dbae857c5cdaeeafe77c9c88ca3bb2632fd Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 6 Feb 2016 15:15:18 +0900 Subject: [PATCH] Allow all extensions and longer comments in filebox --- modules/module/module.controller.php | 17 +++++++++++------ modules/module/schemas/module_filebox.xml | 4 ++-- modules/module/tpl/adminFileBox.html | 2 ++ modules/module/tpl/filebox_list.html | 2 ++ modules/module/tpl/filebox_list_html.html | 2 ++ 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/modules/module/module.controller.php b/modules/module/module.controller.php index b23ca03e7..d3963eb99 100644 --- a/modules/module/module.controller.php +++ b/modules/module/module.controller.php @@ -1242,9 +1242,14 @@ class moduleController extends module $ext = strtolower(substr(strrchr($vars->addfile['name'],'.'),1)); $vars->ext = $ext; - if($vars->filter) $filter = explode(',',$vars->filter); - else $filter = array('jpg','jpeg','gif','png'); - if(!in_array($ext,$filter)) return new Object(-1, 'msg_error_occured'); + if ($vars->filter) + { + $filter = array_map('trim', explode(',',$vars->filter)); + if (!in_array($ext, $filter)) + { + return new Object(-1, 'msg_error_occured'); + } + } $vars->member_srl = $logged_info->member_srl; @@ -1314,9 +1319,9 @@ class moduleController extends module $args->module_filebox_srl = $vars->module_filebox_srl; $args->comment = $vars->comment; - // FIXME $args ?? - - return executeQuery('module.updateModuleFileBox', $vars); + return executeQuery('module.updateModuleFileBox', $args); + $output->add('save_filename', $save_filename); + return $output; } diff --git a/modules/module/schemas/module_filebox.xml b/modules/module/schemas/module_filebox.xml index 939dcb0ab..8dc62bdc2 100644 --- a/modules/module/schemas/module_filebox.xml +++ b/modules/module/schemas/module_filebox.xml @@ -4,6 +4,6 @@ - + - \ No newline at end of file + diff --git a/modules/module/tpl/adminFileBox.html b/modules/module/tpl/adminFileBox.html index 094910b0c..c876e644a 100644 --- a/modules/module/tpl/adminFileBox.html +++ b/modules/module/tpl/adminFileBox.html @@ -63,6 +63,8 @@ + + {basename($val->filename)} diff --git a/modules/module/tpl/filebox_list.html b/modules/module/tpl/filebox_list.html index 97b376c48..a5181fedf 100644 --- a/modules/module/tpl/filebox_list.html +++ b/modules/module/tpl/filebox_list.html @@ -26,6 +26,8 @@ + + {basename($val->filename)} diff --git a/modules/module/tpl/filebox_list_html.html b/modules/module/tpl/filebox_list_html.html index b46a743fa..17b71959f 100644 --- a/modules/module/tpl/filebox_list_html.html +++ b/modules/module/tpl/filebox_list_html.html @@ -17,6 +17,8 @@ + + {basename($val->filename)}