Skip to content

Commit

Permalink
correct validation of hostingplan name and description
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
  • Loading branch information
d00p committed Aug 11, 2023
1 parent faa71ce commit 4711a41
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Froxlor/Api/Commands/HostingPlans.php
Expand Up @@ -200,8 +200,8 @@ public function add()
$value_arr['logviewenabled'] = $this->getBoolParam('logviewenabled', true, 0);

// validation
$name = Validate::validate(trim($name), 'name', '', '', [], true);
$description = Validate::validate(str_replace("\r\n", "\n", $description), 'description', Validate::REGEX_DESC_TEXT);
$name = Validate::validate(trim($name), 'name', Validate::REGEX_DESC_TEXT, '', [], true);
$description = Validate::validate(str_replace("\r\n", "\n", $description), 'description', Validate::REGEX_CONF_TEXT);

if (Settings::Get('system.mail_quota_enabled') != '1') {
$value_arr['email_quota'] = -1;
Expand Down Expand Up @@ -382,8 +382,8 @@ public function update()
$value_arr['logviewenabled'] = $this->getBoolParam('logviewenabled', true, $result['logviewenabled']);

// validation
$name = Validate::validate(trim($name), 'name', '', '', [], true);
$description = Validate::validate(str_replace("\r\n", "\n", $description), 'description', Validate::REGEX_DESC_TEXT);
$name = Validate::validate(trim($name), 'name', Validate::REGEX_DESC_TEXT, '', [], true);
$description = Validate::validate(str_replace("\r\n", "\n", $description), 'description', Validate::REGEX_CONF_TEXT);

if (Settings::Get('system.mail_quota_enabled') != '1') {
$value_arr['email_quota'] = -1;
Expand Down

0 comments on commit 4711a41

Please sign in to comment.