From 9031ae02816d5cf357fce714909ea8ca8d3b8066 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 11 Jan 2018 14:47:51 +0100 Subject: [PATCH] fix return value when ldapPagingSize returns null Signed-off-by: Arthur Schiwon --- apps/user_ldap/lib/Jobs/Sync.php | 4 ++-- apps/user_ldap/tests/Jobs/SyncTest.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/user_ldap/lib/Jobs/Sync.php b/apps/user_ldap/lib/Jobs/Sync.php index dc8a14d111..0cc0be7d3c 100644 --- a/apps/user_ldap/lib/Jobs/Sync.php +++ b/apps/user_ldap/lib/Jobs/Sync.php @@ -176,10 +176,10 @@ class Sync extends TimedJob { true ); - if($connection->ldapPagingSize === 0) { + if((int)$connection->ldapPagingSize === 0) { return false; } - return count($results) >= $connection->ldapPagingSize; + return count($results) >= (int)$connection->ldapPagingSize; } /** diff --git a/apps/user_ldap/tests/Jobs/SyncTest.php b/apps/user_ldap/tests/Jobs/SyncTest.php index c6cb9549b0..75ffd0e828 100644 --- a/apps/user_ldap/tests/Jobs/SyncTest.php +++ b/apps/user_ldap/tests/Jobs/SyncTest.php @@ -159,7 +159,8 @@ class SyncTest extends TestCase { [ 3, 3, true ], [ 3, 5, true ], [ 3, 2, false], - [ 0, 4, false] + [ 0, 4, false], + [ null, 4, false] ]; }