fix: webp가 업로드 가능하나, 메시지 표기가 누락된 버그 수정
This commit is contained in:
@@ -48,7 +48,7 @@ if(!is_uploaded_file($image['tmp_name'])) {
|
|||||||
$response['result'] = false;
|
$response['result'] = false;
|
||||||
} elseif(!$newExt) {
|
} elseif(!$newExt) {
|
||||||
//확장자 검사
|
//확장자 검사
|
||||||
$response['reason'] = 'jpg, gif, png 파일이 아닙니다!';
|
$response['reason'] = 'webp, jpg, gif, png 파일이 아닙니다!';
|
||||||
$response['result'] = false;
|
$response['result'] = false;
|
||||||
} elseif($image['size'] > 30720) {
|
} elseif($image['size'] > 30720) {
|
||||||
//파일크기 검사
|
//파일크기 검사
|
||||||
@@ -70,7 +70,7 @@ if(!is_uploaded_file($image['tmp_name'])) {
|
|||||||
//이미지 저장
|
//이미지 저장
|
||||||
|
|
||||||
while(true){
|
while(true){
|
||||||
$newPicName = dechex(rand(0x000000f,0xfffffff)).$newExt;
|
$newPicName = dechex(rand(0x000000f,0xfffffff)).$newExt;
|
||||||
$dest = AppConf::getUserIconPathFS().'/'.$newPicName;
|
$dest = AppConf::getUserIconPathFS().'/'.$newPicName;
|
||||||
if(file_exists($dest)){
|
if(file_exists($dest)){
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -90,18 +90,18 @@ if($action == 'scrub_icon'){
|
|||||||
|
|
||||||
$cnt = 0;
|
$cnt = 0;
|
||||||
|
|
||||||
foreach(glob(AppConf::getUserIconPathFS().'/*.{jpg,png,gif}', GLOB_BRACE) as $filepath){
|
foreach(glob(AppConf::getUserIconPathFS().'/*.{webp,jpg,png,gif}', GLOB_BRACE) as $filepath){
|
||||||
$filename = basename($filepath);
|
$filename = basename($filepath);
|
||||||
|
|
||||||
if (array_key_exists($filename, $usedIcon)) {
|
if (array_key_exists($filename, $usedIcon)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mtime = filemtime($filepath);
|
$mtime = filemtime($filepath);
|
||||||
if($mtime > $deleteUntil){
|
if($mtime > $deleteUntil){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@unlink($filepath);
|
@unlink($filepath);
|
||||||
$cnt++;
|
$cnt++;
|
||||||
}
|
}
|
||||||
@@ -115,8 +115,8 @@ if($action == 'scrub_icon'){
|
|||||||
if($action == 'scrub_old_user'){
|
if($action == 'scrub_old_user'){
|
||||||
$deleteUntil = TimeUtil::nowAddMinutes(-60*24*30*6);
|
$deleteUntil = TimeUtil::nowAddMinutes(-60*24*30*6);
|
||||||
$targetUser = [];
|
$targetUser = [];
|
||||||
$members = $db->query('SELECT member.no, max(member_log.date) as loginDate from member
|
$members = $db->query('SELECT member.no, max(member_log.date) as loginDate from member
|
||||||
left join member_log on member.`NO` = member_log.member_no and
|
left join member_log on member.`NO` = member_log.member_no and
|
||||||
(member_log.action_type="login" or member_log.action_type="reg") group by member.no');
|
(member_log.action_type="login" or member_log.action_type="reg") group by member.no');
|
||||||
foreach($members as $member){
|
foreach($members as $member){
|
||||||
if($member['loginDate'] === null){
|
if($member['loginDate'] === null){
|
||||||
@@ -186,7 +186,7 @@ if($action == 'delete'){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($action == 'reset_pw'){
|
if($action == 'reset_pw'){
|
||||||
|
|
||||||
$newPassword = Util::randomStr(6);
|
$newPassword = Util::randomStr(6);
|
||||||
$tmpPassword = Util::hashPassword(RootDB::getGlobalSalt(), $newPassword);
|
$tmpPassword = Util::hashPassword(RootDB::getGlobalSalt(), $newPassword);
|
||||||
$newSalt = bin2hex(random_bytes(8));
|
$newSalt = bin2hex(random_bytes(8));
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ require(__DIR__.'/../vendor/autoload.php');
|
|||||||
<form name="change_icon_form" id="change_icon_form" method="post" enctype="multipart/form-data">
|
<form name="change_icon_form" id="change_icon_form" method="post" enctype="multipart/form-data">
|
||||||
<input class="with_skin" type="text" readonly="readonly" id="image_upload_filename">
|
<input class="with_skin" type="text" readonly="readonly" id="image_upload_filename">
|
||||||
<button id="image_upload_fake_btn" class="with_skin">찾아보기</button>
|
<button id="image_upload_fake_btn" class="with_skin">찾아보기</button>
|
||||||
<input type="file" id="image_upload" name="image_upload" accept=".jpg,.jpeg,.png,.gif"><br>
|
<input type="file" id="image_upload" name="image_upload" accept=".webp,.jpg,.jpeg,.png,.gif"><br>
|
||||||
<input class="with_skin" id="btn_image_submit" type="submit" value="아이콘 변경"> <button id="btn_remove_icon" class="with_skin">아이콘 제거</button>
|
<input class="with_skin" id="btn_image_submit" type="submit" value="아이콘 변경"> <button id="btn_remove_icon" class="with_skin">아이콘 제거</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user