Update monero_payments.php

This commit is contained in:
serhack 2017-11-22 18:16:20 +01:00 committed by GitHub
parent 2140291ce8
commit a959a97c2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -316,7 +316,7 @@ class Monero_Gateway extends WC_Payment_Gateway
$payment_id = bin2hex(openssl_random_pseudo_bytes(8));
setcookie('payment_id', $payment_id, time() + 2700);
} else
$payment_id = $_COOKIE['payment_id'];
$payment_id = sanitize_text_field($_COOKIE['payment_id']);
return $payment_id;
}
@ -327,7 +327,7 @@ class Monero_Gateway extends WC_Payment_Gateway
$create_table = "CREATE TABLE IF NOT EXISTS $payment_id (
rate INT
)";
$wpdb->query($create_table);
$wpdb->query($wpdb$create_table);
$rows_num = $wpdb->get_results("SELECT count(*) as count FROM $payment_id");
if ($rows_num[0]->count > 0) // Checks if the row has already been created or not
{