Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent "undefined index" notice if $parts array is empty in Index\Index#removeIndexedDefinition #750

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

asccc
Copy link

@asccc asccc commented Aug 1, 2019

If $level reaches 0 with only one more element in the $parts array, the next call to array_slice($parts, 0, $level) will return an empty array. This will trigger a "undefined index" notice in the next recursion on $part = $parts[$level]. This notice gets promoted to an ErrorException in the error-handler (if the local php.ini is configured to report notices) which will cancel further processing.

Fixes #695

If `$level` reaches 0, `array_slice($parts, 0, $level)` returns an empty array. This will issue a "undefined index notice" in the next recursion on `$part = $parts[$level]`. This notice gets transformed to an ErrorException which will cancel further analysis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined Offset: 0
1 participant