forked from GithubBackups/vichan
Fix weird "Default object created from empty vlaue" error
Looks like $file can be NULL sometimes, though that should be illegal. Probably an unfixed post.php bug...
This commit is contained in:
parent
01cca90597
commit
bb81e9e0c3
@ -357,9 +357,14 @@ class Post {
|
|||||||
if (isset($this->files) && $this->files) {
|
if (isset($this->files) && $this->files) {
|
||||||
$this->files = json_decode($this->files);
|
$this->files = json_decode($this->files);
|
||||||
// Compatibility for posts before individual file hashing
|
// Compatibility for posts before individual file hashing
|
||||||
foreach ($this->files as &$file)
|
foreach ($this->files as $i => &$file) {
|
||||||
|
if (empty($file)) {
|
||||||
|
unset($this->files[$i]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!isset($file->hash))
|
if (!isset($file->hash))
|
||||||
$file->hash = $this->filehash;
|
$file->hash = $this->filehash;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->subject = utf8tohtml($this->subject);
|
$this->subject = utf8tohtml($this->subject);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user