Commit bcb5cf17 by Scott

Fix PHP 7.4 notice when reshowing questions

parent e05ac458
...@@ -93,7 +93,7 @@ function qa_question_set_content($oldquestion, $title, $content, $format, $text, ...@@ -93,7 +93,7 @@ function qa_question_set_content($oldquestion, $title, $content, $format, $text,
qa_post_unindex($comment['postid']); qa_post_unindex($comment['postid']);
} }
if (@$closepost['parentid'] == $oldquestion['postid']) if (isset($closepost) && $closepost['parentid'] == $oldquestion['postid'])
qa_post_unindex($closepost['postid']); qa_post_unindex($closepost['postid']);
qa_db_post_set_type($oldquestion['postid'], 'Q_QUEUED'); qa_db_post_set_type($oldquestion['postid'], 'Q_QUEUED');
...@@ -347,7 +347,7 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie ...@@ -347,7 +347,7 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie
qa_post_unindex($comment['postid']); qa_post_unindex($comment['postid']);
} }
if (@$closepost['parentid'] == $oldquestion['postid']) if (isset($closepost) && $closepost['parentid'] == $oldquestion['postid'])
qa_post_unindex($closepost['postid']); qa_post_unindex($closepost['postid']);
$setupdated = false; $setupdated = false;
...@@ -421,7 +421,7 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie ...@@ -421,7 +421,7 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie
} }
} }
if ($closepost['parentid'] == $oldquestion['postid']) { if (isset($closepost) && $closepost['parentid'] == $oldquestion['postid']) {
qa_post_index($closepost['postid'], $closepost['type'], $oldquestion['postid'], $closepost['parentid'], null, qa_post_index($closepost['postid'], $closepost['type'], $oldquestion['postid'], $closepost['parentid'], null,
$closepost['content'], $closepost['format'], qa_viewer_text($closepost['content'], $closepost['format']), null, $closepost['categoryid']); $closepost['content'], $closepost['format'], qa_viewer_text($closepost['content'], $closepost['format']), null, $closepost['categoryid']);
} }
...@@ -500,7 +500,7 @@ function qa_question_set_category($oldquestion, $categoryid, $userid, $handle, $ ...@@ -500,7 +500,7 @@ function qa_question_set_category($oldquestion, $categoryid, $userid, $handle, $
$otherpostids[] = $comment['postid']; $otherpostids[] = $comment['postid'];
} }
if (@$closepost['parentid'] == $oldquestion['postid']) if (isset($closepost) && $closepost['parentid'] == $oldquestion['postid'])
$otherpostids[] = $closepost['postid']; $otherpostids[] = $closepost['postid'];
qa_db_posts_set_category_path($otherpostids, $newpath); qa_db_posts_set_category_path($otherpostids, $newpath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment