khromov / wp-wpml-geoip-browser-language-redirect

GeoIP Redirector for WPML (WordPress)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plugin cannot be activated, fatal error

iPasqualito opened this issue · comments

unexpected '[' on line 95:

$tmp_ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0];

changed it to $tmp_ip = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'][0]);

and it works.

kind regards

@iPasqualito The above code is PHP 5.4+ only, that's why you got the error. The way you have changed it doesn't retain the functionality.

Compatibility with PHP versions lower than 5.4 is now restored as per 79ea06d