Created validate_device_id() function #257

Merged
merged 2 commits into from Jun 26, 2014

Projects

None yet

2 participants

@laf
Member
laf commented Jun 24, 2014

You can use this to check that a device id is valid.

@paulgear
Member

This should probably check that the device id is non-null as well. I'm assuming that the SQL query would work, but why bother doing it if it's not going to produce a result?

@laf
Member
laf commented Jun 25, 2014

I'll update to check that ID is numerical.

Not sure what you mean by not produce a result. The query returns the device id given so that we know it's a valid id. So we can then use this function anywhere we used to just check device_id is bring used.

@laf
Member
laf commented Jun 25, 2014

Added null check.

@paulgear paulgear merged commit 31a7c11 into librenms:master Jun 26, 2014

1 check passed

default Scrutinizer: No new issues
Details
@laf laf deleted the unknown repository branch Apr 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment