php invalid argument supplied error in ldap module
After upgrading from 6.0.4 to 7 yesterday, i keep getting the following error in the syslog (owncloud logs there) i am using Novell EDIR ldap for my user backend. Debian wheezy 64 bit server, with apache2, php amd mysql server.(all latest debian patches) Everything seems to be working, no problems detected, but maybe it means something.
Jul 24 10:23:10 owncloud ownCloud[32459]: {PHP} Invalid argument supplied for foreach() at /var/www/owncloud/apps/user_ldap/lib/access.php#201 Jul 24 10:23:44 owncloud ownCloud[33191]: {PHP} Invalid argument supplied for foreach() at /var/www/owncloud/apps/user_ldap/lib/access.php#201 Jul 24 10:23:51 owncloud ownCloud[32459]: {PHP} Invalid argument supplied for foreach() at /var/www/owncloud/apps/user_ldap/lib/access.php#201
@blizzz
tagging this for 7.0.1
same here using Windows AD for user backend
the same, error present after upgrade to OC 7.
Could you test whether this patch solves the issue for you?
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 23ba425..9fc646c 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -192,7 +192,7 @@ class Access extends LDAPUtility implements user\IUserTools {
*/
public function getDomainDNFromDN($dn) {
$allParts = $this->ldap->explodeDN($dn, 0);
- if($allParts === false) {
+ if(!is_array($allParts) || empty($allParts)) {
//not a valid DN
return '';
}
:+1: OC Version: 7.0.1 the patch works for me.
OC Version: 7.0.1 Fixed. OK
Thanks guys, I put it to a PR.
FYI, I looked more inside it, because my assumption why this happens did not confirm. Now i found the real (stupid) cause, PR follows, I will kindly ask you to test again in that PR.