Skip to content

Commit

Permalink
sanitize tab image and group image
Browse files Browse the repository at this point in the history
  • Loading branch information
causefx committed May 26, 2022
1 parent b1299cd commit d5245ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/classes/organizr.class.php
Expand Up @@ -5149,6 +5149,8 @@ public function addTab($array)
if (!array_key_exists('image', $array)) {
$this->setAPIResponse('error', 'Tab image was not supplied', 422);
return false;
} else {
$array['image'] = $this->sanitizeUserString($array['image']);
}
$response = [
array(
Expand Down Expand Up @@ -5197,6 +5199,9 @@ public function updateTab($id, $array)
$this->clearTabDefault();
}
}
if (array_key_exists('image', $array)) {
$array['image'] = $this->sanitizeUserString($array['image']);
}
if (array_key_exists('group_id', $array)) {
$groupCheck = (array_key_exists('group_id_max', $array)) ? $array['group_id_max'] : $tabInfo['group_id_max'];
if ($array['group_id'] < $groupCheck) {
Expand Down Expand Up @@ -6782,6 +6787,7 @@ public function updateGroup($id, $array)
$this->setAPIResponse('error', 'Image was set but empty', 409);
return false;
}
$array['image'] = $this->sanitizeUserString($array['image']);
}
if (array_key_exists('default', $array)) {
if ($groupInfo['group_id'] == 0 || $groupInfo['group_id'] == 999) {
Expand Down Expand Up @@ -6868,6 +6874,7 @@ public function addGroup($array)
$this->setAPIResponse('error', 'Group image cannot be empty', 422);
return false;
}
$array['image'] = $this->sanitizeUserString($array['image']);
} else {
$this->setAPIResponse('error', 'Group image was not supplied', 422);
return false;
Expand Down

0 comments on commit d5245ca

Please sign in to comment.