Skip to content

HTTP POST strings fail integer validation #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bensnyde
Copy link

https://github.com/enovance/phpipam/blob/master/api/models/subnet.php includes the following validation:

if($this->allowRequests != 0 || $this->allowRequests !=1) { throw new Exception('Invalid allow requests value'); }
if($this->showName != 0 || $this->showName !=1) { throw new Exception('Invalid show Name value'); }
if($this->pingSubnet != 0 || $this->pingSubnet !=1) { throw new Exception('Invalid ping subnet value'); }

These validations will always fail since HTTP POST variables are strings.

https://github.com/enovance/phpipam/blob/master/api/models/subnet.php includes the following validation:

if($this->allowRequests != 0 || $this->allowRequests !=1)                                { throw new Exception('Invalid allow requests value'); }
if($this->showName != 0 || $this->showName !=1)                                                        { throw new Exception('Invalid show Name value'); }
if($this->pingSubnet != 0 || $this->pingSubnet !=1)                                                { throw new Exception('Invalid ping subnet value'); }

These validations will always fail sine HTTP POST variables are strings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant