Skip to content

Commit

Permalink
version 14.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bgermann committed Mar 25, 2015
1 parent 95e850b commit 57a2dfd
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 13 deletions.
5 changes: 2 additions & 3 deletions cforms-captcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ final class cforms2_question_and_answer extends cforms2_captcha {
private $cforms_settings;

public function __construct() {
srand(microtime()*1000003);
$this->cforms_settings = get_option('cforms_settings');
}

Expand Down Expand Up @@ -120,7 +119,7 @@ public function get_request($input_classes, $input_title) {
private function question_and_answer($n = -1) {
$qall = explode( "\r\n", $this->cforms_settings['global']['cforms_sec_qa'] );
if ($n < 0)
$n = rand( 0, count($qall)-1 );
$n = mt_rand( 0, count($qall)-1 );
$q = explode( '=', $qall[$n]);
array_unshift($q, $n);
return $q;
Expand All @@ -132,7 +131,7 @@ public function render_settings() {

}

add_action('cforms2_add_captcha', array(new cforms2_question_and_answer(), 'add_instance'));
add_filter('cforms2_add_captcha', array(new cforms2_question_and_answer(), 'add_instance'));

add_action( 'wp_ajax_cforms2_reset_captcha', 'cforms2_reset_captcha' );
add_action( 'wp_ajax_nopriv_cforms2_reset_captcha', 'cforms2_reset_captcha' );
Expand Down
2 changes: 1 addition & 1 deletion cforms-global-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
} else if( isset($_REQUEST['cforms_rsskeysnew']) ) {

### new RSS key computed
$cformsSettings['global']['cforms_rsskeyall'] = md5(rand());
$cformsSettings['global']['cforms_rsskeyall'] = md5(mt_rand());
update_option('cforms_settings',$cformsSettings);

} else if( isset($_REQUEST['restoreallcformsdata']) )
Expand Down
2 changes: 1 addition & 1 deletion cforms-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@

### new RSS key computed
if( isset($_REQUEST['cforms_rsskeysnew']) ) {
$cformsSettings['form'.$no]['cforms'.$no.'_rsskey'] = md5(rand());
$cformsSettings['form'.$no]['cforms'.$no.'_rsskey'] = md5(mt_rand());
update_option('cforms_settings',$cformsSettings);
}

Expand Down
4 changes: 2 additions & 2 deletions cforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
* Plugin URI: https://wordpress.org/plugins/cforms2/
* Description: cformsII offers unparalleled flexibility in deploying contact forms across your blog. Features include: comprehensive SPAM protection, Ajax support, Backup & Restore, Multi-Recipients, Role Manager support, Database tracking and many more.
* Author: Oliver Seidel, Bastian Germann
* Version: 14.9
* Version: 14.9.1
* Text Domain: cforms
* Domain Path: ____Plugin_Localization
*/

global $localversion;
$localversion = '14.9';
$localversion = '14.9.1';

### db settings
global $wpdb;
Expand Down
4 changes: 2 additions & 2 deletions lib_activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function cforms2_setup_db () {
cforms2_setINI('form','cforms_dontclear', false);

### tracking settings
cforms2_setINI('form','cforms_rsskey', md5(rand()) );
cforms2_setINI('form','cforms_rsskey', md5(mt_rand()) );
cforms2_setINI('form','cforms_rss', false );
cforms2_setINI('form','cforms_rss_count', 5 );

Expand Down Expand Up @@ -126,7 +126,7 @@ function cforms2_setup_db () {
cforms2_setINI('global','cforms_upload_err4', __('File upload failed. Please try again or contact the blog admin.', 'cforms'));
cforms2_setINI('global','cforms_upload_err5', __('File not accepted, file type not allowed.', 'cforms'));

cforms2_setINI('global','cforms_rsskeyall', md5(rand()) );
cforms2_setINI('global','cforms_rsskeyall', md5(mt_rand()) );
cforms2_setINI('global','cforms_rssall', false );
cforms2_setINI('global','cforms_rssall_count', 5 );

Expand Down
4 changes: 2 additions & 2 deletions lib_options_add.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/*
* Copyright (c) 2006-2012 Oliver Seidel (email : oliver.seidel @ deliciousdays.com)
* Copyright (c) 2014 Bastian Germann
* Copyright (c) 2014-2015 Bastian Germann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -23,7 +23,7 @@
$cformsSettings['global']['cforms_formcount'] = (string)($FORMCOUNT);

### new settings container
$cformsSettings['form'.$no]['cforms'.$no.'_rsskey'] = md5(rand());
$cformsSettings['form'.$no]['cforms'.$no.'_rsskey'] = md5(mt_rand());
$cformsSettings['form'.$no]['cforms'.$no.'_rss'] = false;
$cformsSettings['form'.$no]['cforms'.$no.'_rss_count'] = 5;

Expand Down
3 changes: 1 addition & 2 deletions lib_validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@
else if( array_key_exists($field_type, $captchas) ){ ### pluggable captcha

$validations[$i+$off] = 1;
trigger_error(var_export($_REQUEST,1));
if ( !$captchas[$field_type]->check_response($_REQUEST[$field_type + '/hint'], $_REQUEST[$field_type]) ) {
if ( !$captchas[$field_type]->check_response($_REQUEST[$field_type . '/hint'], $_REQUEST[$field_type]) ) {
$validations[$i+$off] = 0;
$err = $err ? $err : 2;
}
Expand Down

0 comments on commit 57a2dfd

Please sign in to comment.