mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
fix warning about use of regexp on undef string
This commit is contained in:
@@ -29,11 +29,11 @@ sub encrypt_md5
|
||||
{
|
||||
my ($passwd, $salt) = @_;
|
||||
my $magic = '$1$';
|
||||
if ($salt =~ /^\$1\$([^\$]+)/) {
|
||||
if ($salt && $salt =~ /^\$1\$([^\$]+)/) {
|
||||
# Extract actual salt from already encrypted password
|
||||
$salt = $1;
|
||||
}
|
||||
if ($salt !~ /^[a-z0-9\/\.]{8}$/i) {
|
||||
if ($salt && $salt !~ /^[a-z0-9\/\.]{8}$/i) {
|
||||
# Non-MD5 salt
|
||||
$salt = undef;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user