mirror of
https://github.com/openvk/openvk
synced 2024-11-15 11:39:13 +03:00
Use only attachPic for grabbing pic attachments
TODO throw flashFail on bruh moment with pic attachments
This commit is contained in:
parent
b2534c459c
commit
83714213f2
1 changed files with 9 additions and 10 deletions
|
@ -257,19 +257,18 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
$photo = Photo::fastMake($this->user->id, $this->postParam("text"), $_FILES["_pic_attachment"], $album, $anon);
|
$photo = Photo::fastMake($this->user->id, $this->postParam("text"), $_FILES["_pic_attachment"], $album, $anon);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
foreach($_FILES as $file) {
|
$album = NULL;
|
||||||
bdump($file);
|
if(!$anon && $wall > 0 && $wall === $this->user->id)
|
||||||
if($file["error"] === UPLOAD_ERR_OK && preg_match('/^image\//', $file['type'])) {
|
$album = (new Albums)->getUserWallAlbum($wallOwner);
|
||||||
$album = NULL;
|
|
||||||
if(!$anon && $wall > 0 && $wall === $this->user->id)
|
|
||||||
$album = (new Albums)->getUserWallAlbum($wallOwner);
|
|
||||||
|
|
||||||
$photos[] = Photo::fastMake($this->user->id, $this->postParam("text"), $file, $album, $anon);
|
foreach($_FILES as $fileId => $file) {
|
||||||
}
|
bdump([$fileId, $file, $file["error"] !== UPLOAD_ERR_OK, strncmp($fileId, "attachPic", 9) !== 0]);
|
||||||
|
if($file["error"] !== UPLOAD_ERR_OK || strncmp($fileId, "attachPic", 9) !== 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$photos[] = Photo::fastMake($this->user->id, $this->postParam("text"), $file, $album, $anon);
|
||||||
}
|
}
|
||||||
|
|
||||||
bdump($photos);
|
|
||||||
|
|
||||||
if($_FILES["_vid_attachment"]["error"] === UPLOAD_ERR_OK)
|
if($_FILES["_vid_attachment"]["error"] === UPLOAD_ERR_OK)
|
||||||
$video = Video::fastMake($this->user->id, $this->postParam("text"), $_FILES["_vid_attachment"], $anon);
|
$video = Video::fastMake($this->user->id, $this->postParam("text"), $_FILES["_vid_attachment"], $anon);
|
||||||
} catch(\DomainException $ex) {
|
} catch(\DomainException $ex) {
|
||||||
|
|
Loading…
Reference in a new issue