파비콘이 업로드 되지 않는 이슈 해결

정규식 검사에서 업로드된 file의 타입을 검사함으로서 파일이 등록되지 않는 이슈.

정상적인 ico 파일 업로드시 '*.ico 파일만 업로드 가능합니다.' 라는 오류 출력

tmp file의 'name'을 검사하도록 변경하여 이슈 해결
This commit is contained in:
upgle 2014-05-14 16:15:39 +05:45
parent 1b9df4ca39
commit 59067047d1

View file

@ -328,14 +328,13 @@ class installAdminController extends install
private function saveIconTmp($icon, $iconname)
{
$target_file = $icon['tmp_name'];
$type = $icon['type'];
$relative_filename = 'files/attach/xeicon/tmp/'.$iconname;
$target_filename = _XE_PATH_.$relative_filename;
list($width, $height, $type_no, $attrs) = @getimagesize($target_file);
if($iconname == 'favicon.ico')
{
if(!preg_match('/^.*\.ico$/i',$type)) {
if(!preg_match('/^.*\.ico$/i',$icon['name'])) {
Context::set('msg', '*.ico '.Context::getLang('msg_possible_only_file'));
return;
}
@ -346,7 +345,7 @@ class installAdminController extends install
}
else if($iconname == 'mobicon.png')
{
if(!preg_match('/^.*\.png$/i',$type)) {
if(!preg_match('/^.*\.png$/i',$icon['name'])) {
Context::set('msg', '*.png '.Context::getLang('msg_possible_only_file'));
return;
}