Skip to content

Commit ca0d445

Browse files
authored
Merge pull request #721 from Worteks/fix_720
captcha in sendsms check when needed only
2 parents 707ed36 + 030168c commit ca0d445

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

htdocs/sendsms.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,7 @@
3838
$sessiontoken = "";
3939
$attempts = 0;
4040

41-
#==============================================================================
42-
# Check captcha
43-
#==============================================================================
44-
if ($use_captcha) { $result = global_captcha_check();}
45-
46-
if (! ($result === "") ) {
47-
# result was already set
48-
# done this way to keep indentation
49-
} elseif (!$crypt_tokens) {
41+
if (!$crypt_tokens) {
5042
$result = "crypttokensrequired";
5143
} elseif (isset($_REQUEST["smstoken"]) and isset($_REQUEST["token"])) {
5244
$token = strval($_REQUEST["token"]);
@@ -106,9 +98,15 @@
10698
$result = "emptysendsmsform";
10799
}
108100

109-
# Check the entered username for characters that our installation doesn't support
110101
if ( $result === "" ) {
111-
$result = check_username_validity($login,$login_forbidden_chars);
102+
# Check captcha
103+
if ($use_captcha) {
104+
$result = global_captcha_check();
105+
}
106+
# Check the entered username for characters that our installation doesn't support
107+
if ( $result === "" ) {
108+
$result = check_username_validity($login,$login_forbidden_chars);
109+
}
112110
}
113111

114112
#==============================================================================
@@ -261,7 +259,6 @@
261259
}
262260
}
263261
}
264-
265262
}
266263

267264
#==============================================================================

0 commit comments

Comments
 (0)