Commit c1bac018 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5808-multibyte-functions-should-be-used-to-truncate-strings' into '1.3-dev'

Resolve "multibyte functions should be used to truncate strings"

See merge request fusiondirectory/fd!194
Showing with 4 additions and 4 deletions
+4 -4
...@@ -718,9 +718,9 @@ class user extends simplePlugin ...@@ -718,9 +718,9 @@ class user extends simplePlugin
return _('The passwords you\'ve entered as "New password" and "Repeated new password" do not match.'); return _('The passwords you\'ve entered as "New password" and "Repeated new password" do not match.');
} elseif ($new_password == '') { } elseif ($new_password == '') {
return msgPool::required(_('New password')); return msgPool::required(_('New password'));
} elseif ($check_differ && (substr($current_password, 0, $differ) == substr($new_password, 0, $differ))) { } elseif ($check_differ && (mb_substr($current_password, 0, $differ) == mb_substr($new_password, 0, $differ))) {
return _('The password used as new and current are too similar.'); return _('The password used as new and current are too similar.');
} elseif ($check_length && (strlen($new_password) < $length)) { } elseif ($check_length && (mb_strlen($new_password) < $length)) {
return _('The password used as new is too short.'); return _('The password used as new is too short.');
} elseif (!passwordMethod::is_harmless($new_password)) { } elseif (!passwordMethod::is_harmless($new_password)) {
return _('The password contains possibly problematic Unicode characters!'); return _('The password contains possibly problematic Unicode characters!');
......
...@@ -81,8 +81,8 @@ class userRoles extends simplePlugin ...@@ -81,8 +81,8 @@ class userRoles extends simplePlugin
foreach ($groupsattrs as $dn => $groupattr) { foreach ($groupsattrs as $dn => $groupattr) {
$groupDisplay = $groupattr['cn']; $groupDisplay = $groupattr['cn'];
if (isset($groupattr['description'])) { if (isset($groupattr['description'])) {
if (strlen($groupattr['description']) > 50) { if (mb_strlen($groupattr['description']) > 50) {
$groupattr['description'] = substr($groupattr['description'], 0, 50).'…'; $groupattr['description'] = mb_substr($groupattr['description'], 0, 50).'…';
} }
$groupDisplay .= ' ['.$groupattr['description'].']'; $groupDisplay .= ' ['.$groupattr['description'].']';
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment