Skip to content

Commit

Permalink
made compatible with older php versions
Browse files Browse the repository at this point in the history
  • Loading branch information
geek-at committed Nov 11, 2023
1 parent 9fe2a18 commit 069e7ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/inc/OpenTrashmailBackend.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function run(){
http_response_code(404);
exit(json_encode(['error'=>'Email ID not found']));
}
else if(!ctype_digit($id))
else if(!is_numeric($id))
{
http_response_code(400);
exit(json_encode(['error'=>'Invalid ID']));
Expand Down Expand Up @@ -117,7 +117,7 @@ function deleteMail($email,$id)
{
if(!filter_var($email, FILTER_VALIDATE_EMAIL))
return $this->error('Invalid email address');
else if(!ctype_digit($id))
else if(!is_numeric($id))
return $this->error('Invalid id');
else if(!emailIDExists($email,$id))
return $this->error('Email not found');
Expand All @@ -129,7 +129,7 @@ function getRawMail($email,$id,$htmlbody=false)
{
if(!filter_var($email, FILTER_VALIDATE_EMAIL))
return $this->error('Invalid email address');
else if(!ctype_digit($id))
else if(!is_numeric($id))
return $this->error('Invalid id');
else if(!emailIDExists($email,$id))
return $this->error('Email not found');
Expand All @@ -147,7 +147,7 @@ function getAttachment($email,$attachment)
$attachment = substr($attachment,14);
if(!filter_var($email, FILTER_VALIDATE_EMAIL))
return $this->error('Invalid email address');
else if(!ctype_digit($id))
else if(!is_numeric($id))
return $this->error('Invalid id');
else if(!emailIDExists($email,$id))
return $this->error('Email not found');
Expand All @@ -166,7 +166,7 @@ function readMail($email,$id)
{
if(!filter_var($email, FILTER_VALIDATE_EMAIL))
return $this->error('Invalid email address');
else if(!ctype_digit($id))
else if(!is_numeric($id))
return $this->error('Invalid id');
else if(!emailIDExists($email,$id))
return $this->error('Email not found');
Expand Down

0 comments on commit 069e7ea

Please sign in to comment.