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

Check global is array before reading its values #7

Closed

Conversation

YKWeyer
Copy link

@YKWeyer YKWeyer commented Sep 15, 2022

Using in_array on a null value will return an Exception with PHP8 and later.

<b>Fatal error</b>:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /var/www/html/user/plugins/yourls-domainlimit-plugin/plugin.php:28

This MR extends the condition to start by checking the global variable actually is an array before even trying to look for a value in it.

@nicwaller
Copy link
Owner

Thank you for suggesting this fix! It was included with #10 and released as version 1.1.1.

@nicwaller nicwaller closed this Feb 23, 2024
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.

2 participants