xpressengine / xe-core

XpressEngine 1.x
https://xe1.xpressengine.com
Other
89 stars 62 forks source link

서드파티 모듈에서 파일 업로드시 file is not exist 발생 #2422

Closed wookho closed 4 years ago

wookho commented 4 years ago

https://xetown.com/questions/1265395

모듈 개발자의 의견

확인을 해보니 xe 코어에서 파일 배열 데이터를 가져올때 만약 배열이 비어있는 경우엔 $_FILES 배열의 값을 날려버려서 발생한 문제더군요.. 라이믹스에선 이 부분에 대해 대처가 되어있어서 정상작동 하는걸로 보여집니다.

https://github.com/xpressengine/xe-core/blob/6c018e0e2d0dc75ad01c0f881d45d56a5a643097/classes/context/Context.class.php#L1500,L1513

https://github.com/rhymix/rhymix/blob/1d22aa9a448c84cf09548c884b11cd378a1610df/classes/context/Context.class.php#L1274,L1297

일단 임시조치 방법은 if($val['name'] === '' && $val['size'] == 0) { continue; }

추가할 두번째 코드

if($val['name'][$i] === '' && $val['size'][$i] == 0) { continue; }

이 코드를 첫 번째 링크에 있는 파일(/classes/context/Context.class.php)을 두 번째 링크에 있는것 처럼 if문 안쪽과 else문 안쪽의 foreach문에다 삽입하시면 됩니다.