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

Quick fix for warning on empty useragent whitelist #21

Closed
wants to merge 3 commits into from
Closed

Quick fix for warning on empty useragent whitelist #21

wants to merge 3 commits into from

Conversation

miguelpayet
Copy link
Contributor

After upgrading to 2.6.0, started getting an error when going into preferences pane, a warning such as follows:

screen shot 2015-03-19 at 1 16 29 pm

Added a check for the user agent list to not be null before doing the implode().

Quick fix for a warning on call to implode() when an empty useragent whitelist is read.
Happened on a 2.6.0 site that has just been upgraded from 2.5.3.

The warning is:
Symphony Warning: implode(): Invalid arguments passed
An error occurred in /Users/miguel/Sites/susanwagner/extensions/maintenance_mode/extension.driver.php around line 90
Quick fix for a warning on call to implode() when useragent whitelist is empty. 
This happens on a site that was upgraded from 2.5.3 to 2.6.0.
Avoid warning on invalid parameters for implode() function when useragent white list is empty.

Fixed previous commit according to Nicolas Brassard's suggestions: 

"Please always add curly braces for any statement. Doing like this is error-prone. 
I would also check for is_array() and empty() instead of just checking falsiness."
@nitriques
Copy link
Member

Merged into integration. Thanks! I'll release 1.9.1 right now.

@nitriques nitriques closed this Mar 20, 2015
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