aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fcontest.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fcontest.php b/src/fcontest.php
index 313cf82..d927529 100644
--- a/src/fcontest.php
+++ b/src/fcontest.php
@@ -1094,7 +1094,10 @@ function DBUserUpdate($contest, $site, $user, $username, $userfull, $userdesc, $
else $temp = $a["userpassword"];
$lentmp = strlen($temp);
$temp = bighexsub($passn, $temp);
- $newpass = substr($temp, strlen($temp)-$lentmp);
+ if($lentmp > strlen($temp))
+ $newpass = '0' . $temp;
+ else
+ $newpass = substr($temp, strlen($temp)-$lentmp);
$c = DBConnect();
DBExec($c, "begin work");