1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-24 23:50:11 +01:00

Handle NULL files in class Post

This commit is contained in:
8chan 2015-02-25 17:15:45 -08:00
parent 8db4baccca
commit 46ba60fff1

View File

@ -360,6 +360,7 @@ class Post {
if (isset($this->files) && $this->files) {
$this->files = is_string($this->files) ? json_decode($this->files) : $this->files;
// Compatibility for posts before individual file hashing
if ($this->files) {
foreach ($this->files as $i => &$file) {
if (empty($file)) {
unset($this->files[$i]);
@ -369,6 +370,7 @@ class Post {
$file->hash = $this->filehash;
}
}
}
$this->subject = utf8tohtml($this->subject);
$this->name = utf8tohtml($this->name);