WP-Click-Track 0.7.2 Released
Published: 08/03/2010
Programming, Code
Today I finally found the time to release an update to wp-click-track with a few bugs that some users have been encountering. This release is purely a bug fix release so there won’t be any new bells or whistles but if you run IIS 6 or want to clear out some links or reset your system you’re in luck. The only “interesting” bug that was fixed was the IIS6 HTTPS issue.
Because of how IIS6 and PHP populate the $_SERVER value some users were experiencing issues with their stats page. Turns out that IIS6 will return a value of “off” if the request wasn’t made through HTTPS instead of the default behavior of returning a boolean. So, while the below code will work with Apache and newer versions of IIS, IIS6 creates a bit of a false positive:
<?php if(isset($_SERVER)) { //server has HTTPS but IIS6 will always think it's on } ?>
Instead, it’s better to check the value along with the existance check like:
<?php if(isset($_SERVER) && $_SERVER != 'off') { //server has HTTPS and IIS6 is being account for } ?>
Go Microsoft 😊