1EdTech / LTI-Tool-Provider-Library-PHP

Apache License 2.0
68 stars 74 forks source link

Capabilities check not working due to array_flip #27

Open screambeard opened 7 years ago

screambeard commented 7 years ago

In the ToolProvider class a check is made on the capabilities.

Line 895 states the following: if (!in_array($name, $capabilities) && !in_array($name, array_flip($capabilities))) {

However the use of array_flip in combination with == in line 895 causes every capability to pass, since string == 0 is true (see link)

Either remove the array_flip part, since I don't think it is needed. Or make it a strong comparison: ===