From 1c2770963b6eac707d73125ebcc9223c20bf3da8 Mon Sep 17 00:00:00 2001 From: e107steved Date: Mon, 28 May 2007 20:36:15 +0000 Subject: [PATCH] Extra checks on returned data --- e107_plugins/forum/forum_post.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index ff95183e5..8879703b4 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $ -| $Revision: 1.5 $ -| $Date: 2007-05-28 15:17:13 $ +| $Revision: 1.6 $ +| $Date: 2007-05-28 20:36:15 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -44,7 +44,14 @@ if ($action == 'rp') { // reply to thread $thread_info = $forum->thread_get($id, 'last', 11); - $forum_info = $forum->forum_get($thread_info['head']['thread_forum_id']); + if (!is_array($thread_info) || !count($thread_info)) + { + $forum_info = FALSE; // Someone fed us a dud forum id - should exist if replying + } + else + { + $forum_info = $forum->forum_get($thread_info['head']['thread_forum_id']); + } } elseif ($action == 'nt') { @@ -61,7 +68,7 @@ elseif ($action == 'quote' || $action == 'edit') } } -if (!check_class($forum_info['forum_postclass']) || !check_class($forum_info['parent_postclass'])) { +if (($forum_info === FALSE) || !check_class($forum_info['forum_postclass']) || !check_class($forum_info['parent_postclass'])) { require_once(HEADERF); $ns->tablerender(LAN_20, "
".LAN_399."
"); require_once(FOOTERF);