From 46ba60fff12ff669ac5ea0d3a1d08f7f2a172cf1 Mon Sep 17 00:00:00 2001 From: 8chan Date: Wed, 25 Feb 2015 17:15:45 -0800 Subject: [PATCH] Handle NULL files in class Post --- inc/display.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/inc/display.php b/inc/display.php index bd180f5a..d595e5d0 100644 --- a/inc/display.php +++ b/inc/display.php @@ -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]); @@ -368,6 +369,7 @@ class Post { if (!isset($file->hash)) $file->hash = $this->filehash; } + } } $this->subject = utf8tohtml($this->subject);