mirror of
https://github.com/openvk/openvk
synced 2024-12-23 17:12:01 +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,18 +257,17 @@ final class WallPresenter extends OpenVKPresenter
|
|||
$photo = Photo::fastMake($this->user->id, $this->postParam("text"), $_FILES["_pic_attachment"], $album, $anon);
|
||||
} */
|
||||
|
||||
foreach($_FILES as $file) {
|
||||
bdump($file);
|
||||
if($file["error"] === UPLOAD_ERR_OK && preg_match('/^image\//', $file['type'])) {
|
||||
$album = NULL;
|
||||
if(!$anon && $wall > 0 && $wall === $this->user->id)
|
||||
$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)
|
||||
$video = Video::fastMake($this->user->id, $this->postParam("text"), $_FILES["_vid_attachment"], $anon);
|
||||
|
|
Loading…
Reference in a new issue