mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/13522] Remove unneeded variables and correctly output input on error
PHPBB3-13522
This commit is contained in:
parent
4167be1e2c
commit
8e737e483e
1 changed files with 5 additions and 9 deletions
|
@ -691,13 +691,11 @@ class qa
|
||||||
{
|
{
|
||||||
if ($question = $this->acp_get_question_data($question_id))
|
if ($question = $this->acp_get_question_data($question_id))
|
||||||
{
|
{
|
||||||
$answers = (isset($question_input['answers'][$lang])) ? $question_input['answers'][$lang] : implode("\n", $question['answers']);
|
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'QUESTION_TEXT' => ($question_input['question_text']) ? $question_input['question_text'] : $question['question_text'],
|
'QUESTION_TEXT' => ($question_input['question_text']) ? $question_input['question_text'] : $question['question_text'],
|
||||||
'LANG_ISO' => ($question_input['lang_iso']) ? $question_input['lang_iso'] : $question['lang_iso'],
|
'LANG_ISO' => ($question_input['lang_iso']) ? $question_input['lang_iso'] : $question['lang_iso'],
|
||||||
'STRICT' => (isset($_REQUEST['strict'])) ? $question_input['strict'] : $question['strict'],
|
'STRICT' => (isset($_REQUEST['strict'])) ? $question_input['strict'] : $question['strict'],
|
||||||
'ANSWERS' => $answers,
|
'ANSWERS' => implode("\n", $question['answers']),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -711,15 +709,13 @@ class qa
|
||||||
'QUESTION_TEXT' => $question_input['question_text'],
|
'QUESTION_TEXT' => $question_input['question_text'],
|
||||||
'LANG_ISO' => $question_input['lang_iso'],
|
'LANG_ISO' => $question_input['lang_iso'],
|
||||||
'STRICT' => $question_input['strict'],
|
'STRICT' => $question_input['strict'],
|
||||||
'ANSWERS' => $question_input['answers'],
|
'ANSWERS' => (is_array($question_input['answers'])) ? implode("\n", $question_input['answers']) : '',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($submit && check_form_key($form_key))
|
if ($submit && check_form_key($form_key))
|
||||||
{
|
{
|
||||||
$data = $this->acp_get_question_input();
|
if (!$this->validate_input($question_input))
|
||||||
|
|
||||||
if (!$this->validate_input($data))
|
|
||||||
{
|
{
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_ERROR' => true,
|
'S_ERROR' => true,
|
||||||
|
@ -729,11 +725,11 @@ class qa
|
||||||
{
|
{
|
||||||
if ($question_id)
|
if ($question_id)
|
||||||
{
|
{
|
||||||
$this->acp_update_question($data, $question_id);
|
$this->acp_update_question($question_input, $question_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->acp_add_question($data);
|
$this->acp_add_question($question_input);
|
||||||
}
|
}
|
||||||
|
|
||||||
add_log('admin', 'LOG_CONFIG_VISUAL');
|
add_log('admin', 'LOG_CONFIG_VISUAL');
|
||||||
|
|
Loading…
Add table
Reference in a new issue