diff options
author | Nicolas Grekas <nicolas.grekas@gmail.com> | 2015-06-19 14:55:04 +0200 |
---|---|---|
committer | Nicolas Grekas <nicolas.grekas@gmail.com> | 2015-07-16 11:00:04 +0200 |
commit | 472d48f6e32168bb7309a4869e469eb305d95f14 (patch) | |
tree | 21317d12e130ced3f7fcd9b8a26e3f6c423aa903 /apps/user_ldap | |
parent | 5c2646a4bfe235487ba4177bd5733a278ab2101e (diff) | |
download | nextcloud-server-472d48f6e32168bb7309a4869e469eb305d95f14.tar.gz nextcloud-server-472d48f6e32168bb7309a4869e469eb305d95f14.zip |
Do not use OC*::mb_*_replace(), they are useless
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/group_ldap.php | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/access.php | 5 | ||||
-rw-r--r-- | apps/user_ldap/lib/wizard.php | 3 |
3 files changed, 5 insertions, 9 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 0395a4a80e3..6fcdfae0790 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -518,8 +518,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { if($isMemberUid) { //we got uids, need to get their DNs to 'translate' them to user names $filter = $this->access->combineFilterWithAnd(array( - \OCP\Util::mb_str_replace('%uid', $member, - $this->access->connection->ldapLoginFilter, 'UTF-8'), + str_replace('%uid', $member, $this->access->connection->ldapLoginFilter), $this->access->getFilterPartForUserSearch($search) )); $ldap_users = $this->access->fetchListOfUsers($filter, 'dn'); @@ -608,8 +607,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { if($isMemberUid) { //we got uids, need to get their DNs to 'translate' them to user names $filter = $this->access->combineFilterWithAnd(array( - \OCP\Util::mb_str_replace('%uid', $member, - $this->access->connection->ldapLoginFilter, 'UTF-8'), + str_replace('%uid', $member, $this->access->connection->ldapLoginFilter), $this->access->getFilterPartForUserSearch($search) )); $ldap_users = $this->access->fetchListOfUsers($filter, 'dn'); diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index f38d11d4be3..c7747abee51 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -605,8 +605,7 @@ class Access extends LDAPUtility implements user\IUserTools { */ public function fetchUsersByLoginName($loginName, $attributes = array('dn')) { $loginName = $this->escapeFilterPart($loginName); - $filter = \OCP\Util::mb_str_replace( - '%uid', $loginName, $this->connection->ldapLoginFilter, 'UTF-8'); + $filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter); $users = $this->fetchListOfUsers($filter, $attributes); return $users; } @@ -985,7 +984,7 @@ class Access extends LDAPUtility implements user\IUserTools { $name = iconv('UTF-8', 'ASCII//TRANSLIT', $name); // Replacements - $name = \OCP\Util::mb_str_replace(' ', '_', $name, 'UTF-8'); + $name = str_replace(' ', '_', $name); // Every remaining disallowed characters will be removed $name = preg_replace('/[^a-zA-Z0-9_.@-]/u', '', $name); diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php index 6ca84c8718f..13ccf805b69 100644 --- a/apps/user_ldap/lib/wizard.php +++ b/apps/user_ldap/lib/wizard.php @@ -630,8 +630,7 @@ class Wizard extends LDAPUtility { if($this->ldap->errno($cr) !== 0) { throw new \Exception($this->ldap->error($cr)); } - $filter = \OCP\Util::mb_str_replace( - '%uid', $loginName, $this->access->connection->ldapLoginFilter, 'UTF-8'); + $filter = str_replace('%uid', $loginName, $this->access->connection->ldapLoginFilter); $this->result->addChange('ldap_test_loginname', count($users)); $this->result->addChange('ldap_test_effective_filter', $filter); return $this->result; |