Skip to content

Commit 79ad509

Browse files
committed
Change checks
1 parent 6776a6a commit 79ad509

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

addons/security_for_login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function hook_login_before_validation()
142142
return;
143143
}
144144

145-
if ($cur_form['form_ip'] != get_remote_address())
145+
if ($cur_form['form_ip'] !== get_remote_address())
146146
$errors[] = security_msg('4');
147147

148148
if ($now - $this->time_min < $cur_form['form_time'])

addons/security_for_post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function hook_post_after_validation()
138138
return;
139139
}
140140

141-
if ($cur_form['form_ip'] != get_remote_address())
141+
if ($cur_form['form_ip'] !== get_remote_address())
142142
$errors[] = security_msg('4');
143143

144144
if ($now - $this->time_min < $cur_form['form_time'])

addons/security_for_register.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function hook_register_after_validation()
124124
return;
125125
}
126126

127-
if (!isset($_POST['req_user']) || !isset($_POST['req_email1']) || !isset($_POST['timezone']) || !isset($_POST['email_setting']))
127+
if (!isset($_POST['req_user'], $_POST['req_email1'], $_POST['timezone'], $_POST['email_setting']) || (empty($_POST['language']) && count(forum_list_langs()) > 1))
128128
$errors[] = security_msg('1');
129129

130130
if (security_test_browser())
@@ -139,7 +139,7 @@ function hook_register_after_validation()
139139
return;
140140
}
141141

142-
if ($cur_form['form_ip'] != get_remote_address())
142+
if ($cur_form['form_ip'] !== get_remote_address())
143143
$errors[] = security_msg('4');
144144

145145
if ($now - $this->time_min < $cur_form['form_time'])

include/security.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function security_show_captcha(int $tabindex, bool $acaptcha = true, bool $qcapt
236236

237237
function security_test_browser()
238238
{
239-
return empty($_SERVER['HTTP_ACCEPT_CHARSET']) && empty($_SERVER['HTTP_ACCEPT_ENCODING']) && empty($_SERVER['HTTP_ACCEPT_LANGUAGE']);
239+
return empty($_SERVER['HTTP_ACCEPT']) || '*/*' == $_SERVER['HTTP_ACCEPT'] || empty($_SERVER['HTTP_ACCEPT_ENCODING']) || empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) || empty($_SERVER['HTTP_ORIGIN']);
240240
}
241241

242242

register.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106

107107
if (!is_valid_email($email1))
108108
$errors[] = $lang_common['Invalid email'];
109-
else if ($pun_config['o_regs_verify'] == '1' && $email1 != $email2)
109+
else if ($pun_config['o_regs_verify'] == '1' && $email1 !== $email2)
110110
$errors[] = $lang_register['Email not match'];
111111

112112
// Check if it's a banned email address

0 commit comments

Comments
 (0)