Skip to content

Commit 4e4afa1

Browse files
committed
Integer type checking
1 parent df382cb commit 4e4afa1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

application/controllers/api/Example.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ public function users_get($id = NULL)
6060

6161
}
6262

63-
6463
// If the id has not been passed via the URL e.g. example/users/:id, then
6564
// check the id query parameter id=? instead
66-
if ($id === NULL)
65+
if ($id === NULL || ctype_digit($id) === FALSE)
6766
{
6867
$id = $this->get('id');
6968
}

0 commit comments

Comments
 (0)