From 7cf77c043e29c79d569af1ebd54ed2bc32a67a41 Mon Sep 17 00:00:00 2001 From: Carsten Schmitz Date: Fri, 20 Jul 2012 10:47:50 +0200 Subject: [PATCH] Fixed issue #6340: Error "String offset cast occured" when adding user and using PHP 5.4 or later --- common_functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common_functions.php b/common_functions.php index d3bdcbfb533..5b114102ddf 100644 --- a/common_functions.php +++ b/common_functions.php @@ -4803,7 +4803,7 @@ function createPassword() for ($i=0; $i<$password_length; $i++) { - $passwd .= $pwchars[floor(rand(0,strlen($pwchars)-1))]; + $passwd .= $pwchars[(int)floor(rand(0,strlen($pwchars)-1))]; } return $passwd; }