mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 01:10:51 +01:00
vichan likes to error on the ban appeals page if this isn't set this way
This commit is contained in:
parent
19fa804116
commit
85471e007e
@ -351,13 +351,20 @@ class Post {
|
|||||||
if (isset($this->files) && $this->files) {
|
if (isset($this->files) && $this->files) {
|
||||||
$this->files = is_string($this->files) ? json_decode($this->files) : $this->files;
|
$this->files = is_string($this->files) ? json_decode($this->files) : $this->files;
|
||||||
// Compatibility for posts before individual file hashing
|
// Compatibility for posts before individual file hashing
|
||||||
foreach ($this->files as $i => &$file) {
|
foreach ($this->files as $i => &$file) {
|
||||||
if (empty($file)) {
|
if (empty($file)) {
|
||||||
unset($this->files[$i]);
|
unset($this->files[$i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!isset($file->hash))
|
if (is_array($file)) {
|
||||||
$file->hash = $this->filehash;
|
if (!isset($file['hash'])) {
|
||||||
|
$file['hash'] = $this->filehash;
|
||||||
|
}
|
||||||
|
} else if (is_object($file)) {
|
||||||
|
if (!isset($file->hash)) {
|
||||||
|
$file->hash = $this->filehash;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user