Skip to content

Commit

Permalink
added sanitize tab name on add and edit
Browse files Browse the repository at this point in the history
  • Loading branch information
causefx committed Apr 10, 2022
1 parent b225527 commit fd5315d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/classes/organizr.class.php
Expand Up @@ -4873,6 +4873,7 @@ public function addTab($array)
$array['type'] = ($array['type']) ?? 1;
$array['order'] = ($array['order']) ?? $this->getNextTabOrder() + 1;
if (array_key_exists('name', $array)) {
$array['name'] = filter_var($array['name'], FILTER_SANITIZE_STRING);
if ($this->isTabNameTaken($array['name'])) {
$this->setAPIResponse('error', 'Tab name: ' . $array['name'] . ' is already taken', 409);
return false;
Expand Down Expand Up @@ -4922,6 +4923,7 @@ public function updateTab($id, $array)
return false;
}
if (array_key_exists('name', $array)) {
$array['name'] = filter_var($array['name'], FILTER_SANITIZE_STRING);
if ($this->isTabNameTaken($array['name'], $id)) {
$this->setAPIResponse('error', 'Tab name: ' . $array['name'] . ' is already taken', 409);
return false;
Expand Down

0 comments on commit fd5315d

Please sign in to comment.