RestServer icon indicating copy to clipboard operation
RestServer copied to clipboard

Improve the error if there is no controller

Open psohm opened this issue 8 years ago • 1 comments

PHP can be configured to show errors when $this->map[$this->method] is called In this case, the user can see the name of the lib It shouldn't show it for security reason :)

psohm avatar May 03 '17 19:05 psohm

This essentially wraps the function in an if statement, which the if statement inside does anyway?

If you are worried about this segment causing errors visible to the user:

$urls = $this->map[$this->method];
if (!$urls) return null;

then it would be better to rewrite this to not generate a warning in the first place:

if (empty($this->map[$this-method])) return null;

I'd probably say that this isn't too great a concern, as production environments would hide these warnings anyway, but I may have misunderstood your intent.

tyzoid avatar Jul 18 '17 02:07 tyzoid