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

Empty parameters are being converted to empty arrays #15

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

Conversation

jeff-cardwell
Copy link

@jeff-cardwell jeff-cardwell commented Nov 21, 2019

If no $modifier was passed to the function, malformed classes were generated because the empty parameter was converted to an empty array. This empty array always satisfied the isset and is_array conditions for the foreach loops that concatenate the $base_class and $blockname to the modifier.

I added a check before the $modifier value is converted to an array to prevent an empty array from being generated.

I went ahead and added a check on the $extra parameter as well, even though it does not present the same issue as it lacks a concatenation when it is being generated.

I also removed the lower is_array checks because by that point, if the parameter value is set it is an array.

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.

1 participant