Skip to content

Instantly share code, notes, and snippets.

@cweagans
Created June 26, 2022 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cweagans/e9af2462d56aaba203c6b71fba69709f to your computer and use it in GitHub Desktop.
Save cweagans/e9af2462d56aaba203c6b71fba69709f to your computer and use it in GitHub Desktop.
diff --git a/classes/wp-security-utility.php b/classes/wp-security-utility.php
index e1c53dc..4f203ef 100644
--- a/classes/wp-security-utility.php
+++ b/classes/wp-security-utility.php
@@ -534,7 +534,9 @@ class AIOWPSecurity_Utility {
$current_unix_time = current_time('timestamp', true);
$previous_hour = $current_unix_time - 3600;
AIOWPSecurity_Utility::is_multisite_install() ? $tbl = $wpdb->sitemeta : $tbl = $wpdb->prefix . 'options';
- $query = $wpdb->prepare("SELECT * FROM {$tbl} WHERE option_name LIKE 'aiowps_captcha_string_info_time_%' AND option_value < %s", $previous_hour);
+ AIOWPSecurity_Utility::is_multisite_install() ? $name_col = 'meta_key' : $name_col = 'option_name';
+ AIOWPSecurity_Utility::is_multisite_install() ? $val_col = 'meta_value' : $val_col = 'option_value';
+ $query = $wpdb->prepare("SELECT * FROM {$tbl} WHERE {$name_col} LIKE 'aiowps_captcha_string_info_time_%' AND {$val_col} < %s", $previous_hour);
$res = $wpdb->get_results($query, ARRAY_A);
if (!empty($res)) {
foreach ($res as $item) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment