Plugin should not change the PHP timezone
-
Good time of day,
I couldn’t find a bug tracker for the plugin, so I’ll post this here.
Google Analyticator sets the PHP timezone to UTC if ini_get(‘date.timezone’) fails (line 29 of google-api-php-client/src/Google_Client.php). And ini_get isn’t very reliable (for example, if you run hhvm).
This can cause issues if the end user has a plugin that sets a custom PHP timezone (to work around issues with date.timezone in hhvm or for whatever other reason).
WordPress already sets the default timezone to UTC on init (in wp-settings.php), so unless a user plugin deliberately overrides it, you can expect it to be UTC. If the user deliberately overrides the timezone in a plugin, I think it’s safe to expect that to be the server’s timezone, too.
At the moment we have to patch the timezone override out of Google Analyticator after every upgrade, which is a bit tedious. Any chance the plugin could be updated to fix this?
- The topic ‘Plugin should not change the PHP timezone’ is closed to new replies.