mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
[ticket/13522] Trim array elements before processing further
PHPBB3-13522
This commit is contained in:
parent
874f3584e2
commit
12fe882741
1 changed files with 2 additions and 3 deletions
|
@ -830,12 +830,11 @@ class qa
|
||||||
// Convert answers into array and filter if answers are set
|
// Convert answers into array and filter if answers are set
|
||||||
if (strlen($answers))
|
if (strlen($answers))
|
||||||
{
|
{
|
||||||
$answers = array_filter(explode("\n", $answers), function ($value) {
|
$answers = array_filter(array_map('trim', explode("\n", $answers)), function ($value) {
|
||||||
return trim($value) !== '';
|
return $value !== '';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$question = array(
|
$question = array(
|
||||||
'question_text' => request_var('question_text', '', true),
|
'question_text' => request_var('question_text', '', true),
|
||||||
'strict' => request_var('strict', false),
|
'strict' => request_var('strict', false),
|
||||||
|
|
Loading…
Add table
Reference in a new issue