ShMaunder / JMapMyLDAP

LDAP Integration for Joomla! 2.5+
shmanic.com/tools/jmapmyldap
26 stars 19 forks source link

upgrading to php7.2 joomla gives a warning and forbids logging in #72

Open zebpackard opened 5 years ago

zebpackard commented 5 years ago

After upgrading to php7.2 joomla gives a warning and forbids logging in.

Warning "count" on line 39 JMapMyLDAP/libraries/shmanic/util/ip.php

http://php.net/manual/en/migration72.incompatible.php

Kind of looks like a bug in php. Centos 7

php 7.2.11-1.el7.remi

zebpackard commented 5 years ago

rolled back to 7.1 and everything is fine.

esaeberg commented 5 years ago

It must be from Centos or your PHP setup because there's no problem with Debian Jessie 8.11 and PHP 7.2 or 7.3

koguja commented 5 years ago

I Fixed by inserting the following lines before line 39 in /libraries/shmanic/util/ip.php

if (!is_array($ranges)) { $ranges = array(); }

zebpackard commented 4 years ago

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/html/libraries/shmanic/util/ip.php on line 39

Well it's time to dump 7.1 I'm attaching the whole string so anyone that follows me can google it. I have a hard time seeing this as specific to remi, since it shows up in 7.2 on many platforms on the web. (are you using shmanic for ldap??) I tried koguja's fix and it works, seems a little sketchy moving forward though. I can't assume if I get hit by a bus some joe is going to have fun with this.