if (!isset($postData['files'])) {
return false;
}
+ if (!$this->hasContent($postData)) {
+ return false;
+ }
if (!$this->repo) {
$this->repo = $this->createRepo();
return true;
}
+ protected function hasContent($postData)
+ {
+ foreach ($postData['files'] as $num => $arFile) {
+ if ($_FILES['files']['error'][$num]['upload'] == 0) {
+ return true;
+ }
+ if ($arFile['content'] != '') {
+ return true;
+ }
+ }
+ return false;
+ }
+
public function createRepo()
{
$rs = new Repositories();