Skip to content

Commit

Permalink
limit bookmark name and category to char 50
Browse files Browse the repository at this point in the history
  • Loading branch information
causefx committed May 11, 2022
1 parent dbcc0ef commit 05ebc5a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/plugins/bookmark/plugin.php
Expand Up @@ -575,6 +575,9 @@ public function _addTab($array)
$this->setAPIResponse('error', 'Tab name: ' . $array['name'] . ' is already taken', 409);
return false;
}
if (!$this->qualifyLength($array['name'], 50, true)) {
return false;
}
} else {
$this->setAPIResponse('error', 'Tab name was not supplied', 422);
return false;
Expand Down Expand Up @@ -646,6 +649,9 @@ public function _updateTab($id, $array)
$this->setAPIResponse('error', 'Tab name: ' . $array['name'] . ' is already taken', 409);
return false;
}
if (!$this->qualifyLength($array['name'], 50, true)) {
return false;
}
}
if (array_key_exists('background_color', $array)) {
$array['background_color'] = $this->sanitizeUserString($array['background_color']);
Expand Down Expand Up @@ -887,6 +893,9 @@ public function _addCategory($array)
$this->setAPIResponse('error', 'Category name: ' . $array['category'] . ' is already taken', 409);
return false;
}
if (!$this->qualifyLength($array['category'], 50, true)) {
return false;
}
} else {
$this->setAPIResponse('error', 'Category name was not supplied', 422);
return false;
Expand Down Expand Up @@ -930,6 +939,9 @@ public function _updateCategory($id, $array)
$this->setAPIResponse('error', 'Category name: ' . $array['category'] . ' is already taken', 409);
return false;
}
if (!$this->qualifyLength($array['category'], 50, true)) {
return false;
}
}
if (array_key_exists('default', $array)) {
if ($array['default']) {
Expand Down

0 comments on commit 05ebc5a

Please sign in to comment.