Allow extreme captcha to be solved in both directions

This commit is contained in:
Daniel Winzen
2016-04-14 19:12:15 +02:00
parent 5c62bcef00
commit a4e52edd46
2 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,6 @@
Version 1.16.2 - Apr. 14, 2016
Add CSS classes and move more css to the database Add CSS classes and move more css to the database
Allow extreme captcha to be solved in both directions
Version 1.16.1 - Apr. 13, 2016 Version 1.16.1 - Apr. 13, 2016
Fixed a typo Fixed a typo

View File

@ -1920,7 +1920,8 @@ function create_session($setup){
if($setup){ if($setup){
$U['incognito']=1; $U['incognito']=1;
} }
if(get_setting('captcha')>0 && ($U['status']==1 || get_setting('dismemcaptcha')==0)){ $captcha=(int) get_setting('captcha');
if($captcha!==0 && ($U['status']==1 || get_setting('dismemcaptcha')==0)){
if(!isSet($_REQUEST['challenge'])){ if(!isSet($_REQUEST['challenge'])){
send_error($I['wrongcaptcha']); send_error($I['wrongcaptcha']);
} }
@ -1940,10 +1941,12 @@ function create_session($setup){
} }
$memcached->delete(DBNAME . '-' . PREFIX . "captcha-$_REQUEST[challenge]"); $memcached->delete(DBNAME . '-' . PREFIX . "captcha-$_REQUEST[challenge]");
} }
if($_REQUEST['captcha']!=$code){ if($_REQUEST['captcha']!==$code){
if($captcha!==3 || strrev($_REQUEST['captcha'])!==$code){
send_error($I['wrongcaptcha']); send_error($I['wrongcaptcha']);
} }
} }
}
if($U['status']==1){ if($U['status']==1){
$ga=(int) get_setting('guestaccess'); $ga=(int) get_setting('guestaccess');
if(!valid_nick($U['nickname'])){ if(!valid_nick($U['nickname'])){
@ -3484,7 +3487,7 @@ function load_lang(){
} }
function load_config(){ function load_config(){
define('VERSION', '1.16.1'); // Script version define('VERSION', '1.16.2'); // Script version
define('DBVERSION', 16); // Database version define('DBVERSION', 16); // Database version
define('MSGENCRYPTED', false); // Store messages encrypted in the database to prevent other database users from reading them - true/false - visit the setup page after editing! define('MSGENCRYPTED', false); // Store messages encrypted in the database to prevent other database users from reading them - true/false - visit the setup page after editing!
define('ENCRYPTKEY', 'MY_KEY'); // Encryption key for messages define('ENCRYPTKEY', 'MY_KEY'); // Encryption key for messages