Skip to content
Snippets Groups Projects
Commit 64f06a99 authored by ale's avatar ale
Browse files

Collapse all recaptcha patches into one

parent f3c40b64
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,9 @@
},
"wpackagist-plugin/wp-piwik": {
"Disable Piwik global updates": "patches/plugin/wp-piwik.patch"
},
"wpackagist-plugin/wp-recaptcha-bp": {
"Support for global recaptcha keys": "patches/plugin/wp-recaptcha-bp.patch"
}
}
}
From 9d72bfe515c90800399e0bd209fa386a62fe6393 Mon Sep 17 00:00:00 2001
From: joe <joe@incal.net>
Date: Fri, 16 Nov 2012 10:27:17 +0100
Subject: [PATCH 149/229] Patch to stop recaptcha from dumbly use http://
schema when we are on https
---
wp-content/plugins/wp-recaptcha-bp/wp-plugin.php | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/wp-content/plugins/wp-recaptcha-bp/wp-plugin.php b/wp-content/plugins/wp-recaptcha-bp/wp-plugin.php
index ef05111e..001c8959 100644
--- a/wp-content/plugins/wp-recaptcha-bp/wp-plugin.php
+++ b/wp-content/plugins/wp-recaptcha-bp/wp-plugin.php
@@ -59,9 +59,13 @@ if (!class_exists('WPPlugin')) {
static function plugins_url() {
if (WPPlugin::determine_environment() == Environment::WordPressMU)
- return site_url() . '/wp-content/mu-plugins';
+ $url = site_url() . '/wp-content/mu-plugins';
else
- return site_url() . '/wp-content/plugins';
+ $url = site_url() . '/wp-content/plugins';
+ if ($_SERVER['https'] == 'on') {
+ $url = str_replace('http://', 'https://', $url);
+ }
+ return $url;
}
static function path_to_plugin_directory() {
@@ -72,7 +76,7 @@ if (!class_exists('WPPlugin')) {
static function url_to_plugin_directory() {
$current_directory = basename(dirname(__FILE__));
-
+
return WPPlugin::plugins_url() . "/${current_directory}";
}
--
2.17.1
From 038eb25887261552f68154affc880c510d2acf5d Mon Sep 17 00:00:00 2001
From: joe <joe@autistici.org>
Date: Thu, 19 Sep 2013 00:18:18 +0200
Subject: [PATCH 168/229] set the correct recaptcha key where you have an empty
one
---
wp-content/plugins/wp-recaptcha-bp/recaptcha.php | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
index 7c16045e..a9ea1d6c 100644
--- a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
+++ b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
@@ -111,8 +111,14 @@ class ReCAPTCHAPlugin extends WPPlugin
// set the default options
function register_default_options() {
- if ($this->options)
+ if ($this->options) {
+ if ($this->keys_missing()) {
+ $this->options['site_key'] = GLOBAL_RECAPTCHA_KEY;
+ $this->options['secret'] = GLOBAL_RECAPTCHA_PRIVATE_KEY;
+ WPPlugin::add_options($this->options_name, $this->options);
+ }
return;
+ }
$option_defaults = array();
$old_options = WPPlugin::retrieve_options("recaptcha");
if ($old_options) {
@@ -172,9 +178,11 @@ class ReCAPTCHAPlugin extends WPPlugin
}
function missing_keys_notice() {
+ /*
if ($this->keys_missing()) {
$this->create_error_notice('reCAPTCHA API Keys are missing.');
}
+ */
}
function validate_dropdown($array, $key, $value) {
--
2.17.1
From 77926f741d799b195754acbd96291645e6222014 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Sat, 22 Aug 2015 18:42:44 +0100
Subject: [PATCH 183/229] fix recaptcha validate_user_signup hook
---
wp-content/plugins/wp-recaptcha-bp/recaptcha.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
index a9ea1d6c..2cb535b2 100644
--- a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
+++ b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
@@ -252,7 +252,7 @@ class ReCAPTCHAPlugin extends WPPlugin
$_POST['g-recaptcha-response'] == '') {
$result['errors']->add('blank_captcha',
$this->options['no_response_error']);
- return $result['errors'];
+ return $result;
}
if ($this->_reCaptchaLib == null) {
--
2.17.1
From d295dee2debd70f13656234f5888275779ae4a1b Mon Sep 17 00:00:00 2001
From: lechuck <lechuck@autistici.org>
Date: Sat, 26 Sep 2015 19:28:37 +0100
Subject: [PATCH 184/229] Fixed wp-recaptcha error handling in
show_recaptcha_in_registration
---
wp-content/plugins/wp-recaptcha-bp/recaptcha.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
index 2cb535b2..96d4fee0 100644
--- a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
+++ b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
@@ -211,7 +211,9 @@ class ReCAPTCHAPlugin extends WPPlugin
// if it's for wordpress mu, show the errors
if ($this->is_multi_blog()) {
- $error = $errors->get_error_message('captcha');
+ if( is_wp_error( $errors ) ) {
+ $error = $errors->get_error_message('captcha');
+ }
echo '<label for="verification">Verification:</label>';
echo ($error ? '<p class="error">' . $error . '</p>' : '');
echo $this->get_recaptcha_html();
--
2.17.1
From 54c5277ba96294f6ad3ee970c894896d41d4d537 Mon Sep 17 00:00:00 2001
From: lucha <lucha@paranoici.org>
Date: Tue, 28 Nov 2017 19:46:42 -0800
Subject: [PATCH 206/229] removed obsolete require_once('config.php') from
recaptcha-bp plugin
the configuration directive has been moved to wp-config.php, so it was
duplicated. Should solve part of
https://git.autistici.org/ai/noblogs-wp/issues/13
---
wp-content/plugins/wp-recaptcha-bp/recaptcha.php | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
index 96d4fee0..0ba2fab2 100644
--- a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
+++ b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
@@ -11,7 +11,6 @@
* @link http://www.google.com/recaptcha
*/
-require_once('config.php');
require_once('wp-plugin.php');
if (class_exists('ReCAPTCHAPlugin'))
@@ -138,7 +137,7 @@ class ReCAPTCHAPlugin extends WPPlugin
$option_defaults['comments_theme'] = 'standard';
$option_defaults['recaptcha_language'] = $old_options['recaptcha_language'];
$option_defaults['no_response_error'] = $old_options['no_response_error'];
- } else {
+ } else {
$option_defaults['site_key'] = GLOBAL_RECAPTCHA_KEY;
$option_defaults['secret'] = GLOBAL_RECAPTCHA_PRIVATE_KEY;
$option_defaults['comments_theme'] = 'standard';
@@ -302,7 +301,7 @@ class ReCAPTCHAPlugin extends WPPlugin
<noscript>
<style type='text/css'>#submit {display:none;}</style>
<input name="submit" type="submit" id="submit-alt" tabindex="6"
- value="Submit Comment"/>
+ value="Submit Comment"/>
</noscript>
COMMENT_FORM;
@@ -321,7 +320,7 @@ COMMENT_FORM;
document.getElementById('recaptcha-submit-btn-area').appendChild (sub);
document.getElementById('submit').tabIndex = 6;
if ( typeof _recaptcha_wordpress_savedcomment != 'undefined') {
- document.getElementById('comment').value =
+ document.getElementById('comment').value =
_recaptcha_wordpress_savedcomment;
}
</script>
@@ -406,7 +405,7 @@ JS;
wp_delete_comment($comment->comment_ID);
}
}
-
+
// add a settings link to the plugin in the plugin list
function show_settings_link($links, $file) {
if ($file == plugin_basename($this->path_to_plugin_directory() .
--
2.17.1
From 63979f02406bdd7dd8c4f8cec4964d37c2856b99 Mon Sep 17 00:00:00 2001
From: Joe <joe@autistici.org>
Date: Tue, 10 Sep 2013 14:37:53 +0200
Subject: [PATCH 164/229] adding a define for the global public and private
recaptcha keys.
- Fix all blogs that have an empty recaptcha key.
- require configuration for wp-recaptcha (to define the global keys)
---
wp-content/plugins/wp-recaptcha-bp/recaptcha.php | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
index 73461902..7c16045e 100644
index 73461902f..0ba2fab2d 100644
--- a/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
+++ b/wp-content/plugins/wp-recaptcha-bp/recaptcha.php
@@ -11,6 +11,7 @@
* @link http://www.google.com/recaptcha
*/
@@ -110,13 +110,19 @@ class ReCAPTCHAPlugin extends WPPlugin
+require_once('config.php');
require_once('wp-plugin.php');
if (class_exists('ReCAPTCHAPlugin'))
@@ -115,8 +116,8 @@ class ReCAPTCHAPlugin extends WPPlugin
// set the default options
function register_default_options() {
- if ($this->options)
+ if ($this->options) {
+ if ($this->keys_missing()) {
+ $this->options['site_key'] = GLOBAL_RECAPTCHA_KEY;
+ $this->options['secret'] = GLOBAL_RECAPTCHA_PRIVATE_KEY;
+ WPPlugin::add_options($this->options_name, $this->options);
+ }
return;
+ }
$option_defaults = array();
$old_options = WPPlugin::retrieve_options("recaptcha");
if ($old_options) {
......@@ -33,7 +25,7 @@ index 73461902..7c16045e 100644
// styling
$option_defaults['recaptcha_language'] = $old_options['re_lang'];
@@ -126,14 +127,14 @@ class ReCAPTCHAPlugin extends WPPlugin
@@ -126,14 +132,14 @@ class ReCAPTCHAPlugin extends WPPlugin
} else {
$old_options = WPPlugin::retrieve_options($this->options_name);
if ($old_options) {
......@@ -44,14 +36,65 @@ index 73461902..7c16045e 100644
$option_defaults['comments_theme'] = 'standard';
$option_defaults['recaptcha_language'] = $old_options['recaptcha_language'];
$option_defaults['no_response_error'] = $old_options['no_response_error'];
} else {
- } else {
- $option_defaults['site_key'] = '';
- $option_defaults['secret'] = '';
+ } else {
+ $option_defaults['site_key'] = GLOBAL_RECAPTCHA_KEY;
+ $option_defaults['secret'] = GLOBAL_RECAPTCHA_PRIVATE_KEY;
$option_defaults['comments_theme'] = 'standard';
$option_defaults['recaptcha_language'] = 'en';
$option_defaults['no_response_error'] =
--
2.17.1
@@ -171,9 +177,11 @@ class ReCAPTCHAPlugin extends WPPlugin
}
function missing_keys_notice() {
+ /*
if ($this->keys_missing()) {
$this->create_error_notice('reCAPTCHA API Keys are missing.');
}
+ */
}
function validate_dropdown($array, $key, $value) {
@@ -202,7 +210,9 @@ class ReCAPTCHAPlugin extends WPPlugin
// if it's for wordpress mu, show the errors
if ($this->is_multi_blog()) {
- $error = $errors->get_error_message('captcha');
+ if( is_wp_error( $errors ) ) {
+ $error = $errors->get_error_message('captcha');
+ }
echo '<label for="verification">Verification:</label>';
echo ($error ? '<p class="error">' . $error . '</p>' : '');
echo $this->get_recaptcha_html();
@@ -243,7 +253,7 @@ class ReCAPTCHAPlugin extends WPPlugin
$_POST['g-recaptcha-response'] == '') {
$result['errors']->add('blank_captcha',
$this->options['no_response_error']);
- return $result['errors'];
+ return $result;
}
if ($this->_reCaptchaLib == null) {
diff --git a/wp-content/plugins/wp-recaptcha-bp/wp-plugin.php b/wp-content/plugins/wp-recaptcha-bp/wp-plugin.php
index ef05111ee..001c89597 100644
--- a/wp-content/plugins/wp-recaptcha-bp/wp-plugin.php
+++ b/wp-content/plugins/wp-recaptcha-bp/wp-plugin.php
@@ -59,9 +59,13 @@ if (!class_exists('WPPlugin')) {
static function plugins_url() {
if (WPPlugin::determine_environment() == Environment::WordPressMU)
- return site_url() . '/wp-content/mu-plugins';
+ $url = site_url() . '/wp-content/mu-plugins';
else
- return site_url() . '/wp-content/plugins';
+ $url = site_url() . '/wp-content/plugins';
+ if ($_SERVER['https'] == 'on') {
+ $url = str_replace('http://', 'https://', $url);
+ }
+ return $url;
}
static function path_to_plugin_directory() {
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment