Skip to content

Commit

Permalink
TA: 37233, use internal wrapper instead of POST
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaagen authored and kergomard committed Oct 16, 2023
1 parent c5d8a3a commit 16cb25b
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions Modules/TestQuestionPool/classes/forms/class.ilTagInputGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,21 +167,10 @@ public function setValueByArray($a_values): void
public function checkInput(): bool
{
$lng = $this->lng;

$valid = true;
if (array_key_exists($this->getPostVar(), $_POST)) {
foreach ($_POST[$this->getPostVar()] as $idx => $value) {
$_POST[$this->getPostVar()][$idx] = ilUtil::stripSlashes($value);
}
$_POST[$this->getPostVar()] = array_unique($_POST[$this->getPostVar()]);

if ($this->getRequired() && !trim(implode("", $_POST[$this->getPostVar()]))) {
$valid = false;
}
} elseif ($this->getRequired()) {
$valid = false;
}
if (!$valid) {

$values = array_filter($this->strArray($this->getPostVar()));
if($values === [] && $this->getRequired()) {
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
Expand Down

0 comments on commit 16cb25b

Please sign in to comment.