Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Capabilities check not working due to array_flip #27

Open
screambeard opened this issue Aug 16, 2017 · 0 comments
Open

Capabilities check not working due to array_flip #27

screambeard opened this issue Aug 16, 2017 · 0 comments

Comments

@screambeard
Copy link

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: ===

Izumi-kun added a commit to Izumi-kun/LTI-Tool-Provider-Library-PHP that referenced this issue Jun 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant