Permalink
Browse files

Use mb_strlen instead of count

FIX: Parameter must be an array or an object that implements Countable

Ocurred when creating a new user when using PHP 7.2
  • Loading branch information...
orgito authored and LarsMichelsen committed Jul 27, 2018
1 parent 4a2ec62 commit 42c69f94f6c7f269a24101f340a25dc6004b0250
Showing with 3 additions and 3 deletions.
  1. +3 −3 share/server/core/classes/ViewManageUsers.php
@@ -35,7 +35,7 @@ private function addForm() {
if (!$name)
throw new FieldInputError('name', l('Please specify a name.'));
if (count($name) > AUTH_MAX_USERNAME_LENGTH)
if (mb_strlen($name) > AUTH_MAX_USERNAME_LENGTH)
throw new FieldInputError('name', l('This name is too long.'));
if (!preg_match(MATCH_USER_NAME, $name))
@@ -49,7 +49,7 @@ private function addForm() {
if (!$password1)
throw new FieldInputError('password1', l('Please specify a password.'));
if (count($password1) > AUTH_MAX_PASSWORD_LENGTH)
if (mb_strlen($password1) > AUTH_MAX_PASSWORD_LENGTH)
throw new FieldInputError('password1', l('This password is too long.'));
$password2 = post('password2');
@@ -254,7 +254,7 @@ private function resetPwForm() {
if (!$password1)
throw new FieldInputError('password1', l('Please specify a password.'));
if (count($password1) > AUTH_MAX_PASSWORD_LENGTH)
if (mb_strlen($password1) > AUTH_MAX_PASSWORD_LENGTH)
throw new FieldInputError('password1', l('This password is too long.'));
$password2 = post('password2');

0 comments on commit 42c69f9

Please sign in to comment.