Skip to content

Commit 991753c

Browse files
authored
fix security bug
fix bug, ze ak v DependentCallback vratim prazdne pole (alebo `null`, `empty_string`), tak pre SelectBox sa na server odosle a prejde lubovolna hodnota..
1 parent b838df6 commit 991753c

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/Controls/DependentSelectBox.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,15 @@ private function tryLoadItems()
102102
}
103103

104104

105-
if (count($items) > 0) {
106-
$this->loadHttpData();
105+
$this->loadHttpData();
106+
$this->setItems($items)
107+
->setPrompt($data->getPrompt() === null ? $this->getPrompt() : $data->getPrompt());
107108

108-
$this->setItems($items)
109-
->setPrompt($data->getPrompt() === null ? $this->getPrompt() : $data->getPrompt());
110-
} else {
109+
if (count($items) === 0) {
111110
if ($this->disabledWhenEmpty === true && !$this->isDisabled()) {
112111
$this->setDisabled();
113112
}
114-
}
113+
}
115114
}
116115
}
117116
}

0 commit comments

Comments
 (0)