marcj / php-rest-service

Php-Rest-Service is a very simple and fast PHP class for server-side RESTful JSON APIs.
MIT License
216 stars 74 forks source link

Undefined offset in Server.php #17

Open kheaactua opened 10 years ago

kheaactua commented 10 years ago

Server.php throws an undefined offset error in getMethodMetaData, triggered by the line

if ($pRegMatches && is_array($pRegMatches) && $pRegMatches[$c]) 

I think the last part should be

... && array_key_exists($c, $pRegMatches))

This is caused on a route like /something/([0-9]+)/something that maps to a function with more than one input parameters, like, someFunctions($id, $data);