Skip to content

Commit 373c513

Browse files
authored
Merge pull request #951 from pupi1985/patch-156
Fix several captcha initialization issues
2 parents 5813139 + c0033b3 commit 373c513

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

qa-include/pages/question.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@
276276
$jumptoanchor = 'a' . $formpostid;
277277

278278
} elseif ($formtype == 'a_add' || ($question['answerbutton'] && !$formrequested)) {
279-
$qa_content['a_form'] = qa_page_q_add_a_form($qa_content, 'anew', $captchareason, $question, @$anewin, @$anewerrors, $formtype == 'a_add', $formrequested);
279+
$qa_content['a_form'] = qa_page_q_add_a_form($qa_content, 'anew', $captchareason, $question, @$anewin, $anewerrors ?? [], $formtype == 'a_add', $formrequested);
280280

281281
if ($formrequested) {
282282
$jumptoanchor = 'anew';
@@ -291,12 +291,12 @@
291291
// Prepare content for comments on the question, plus add or edit comment forms
292292

293293
if ($formtype == 'q_close') {
294-
$qa_content['q_view']['c_form'] = qa_page_q_close_q_form($qa_content, $question, 'close', @$closein, @$closeerrors);
294+
$qa_content['q_view']['c_form'] = qa_page_q_close_q_form($qa_content, $question, 'close', @$closein, $closeerrors ?? []);
295295
$jumptoanchor = 'close';
296296

297297
} elseif (($formtype == 'c_add' && $formpostid == $questionid) || ($question['commentbutton'] && !$formrequested)) { // ...to be added
298298
$qa_content['q_view']['c_form'] = qa_page_q_add_c_form($qa_content, $question, $question, 'c' . $questionid,
299-
$captchareason, @$cnewin[$questionid], @$cnewerrors[$questionid], $formtype == 'c_add');
299+
$captchareason, @$cnewin[$questionid], $cnewerrors[$questionid] ?? [], $formtype == 'c_add');
300300

301301
if ($formtype == 'c_add' && $formpostid == $questionid) {
302302
$jumptoanchor = 'c' . $questionid;
@@ -305,7 +305,7 @@
305305

306306
} elseif ($formtype == 'c_edit' && @$commentsfollows[$formpostid]['parentid'] == $questionid) { // ...being edited
307307
$qa_content['q_view']['c_form'] = qa_page_q_edit_c_form($qa_content, 'c' . $formpostid, $commentsfollows[$formpostid],
308-
@$ceditin[$formpostid], @$cediterrors[$formpostid]);
308+
@$ceditin[$formpostid], $cediterrors[$formpostid] ?? []);
309309

310310
$jumptoanchor = 'c' . $formpostid;
311311
$commentsall = $questionid;

0 commit comments

Comments
 (0)