Skip to content

Commit 5f3b5aa

Browse files
committed
.
1 parent 4832d31 commit 5f3b5aa

16 files changed

+1418
-5
lines changed

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"paypal/rest-api-sdk-php": "^1.14"
4+
}
5+
}

composer.lock

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shys-tutorials-handbooks.zip

15.7 MB
Binary file not shown.

tuts.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
Version: 1.5
66
License: GPLv2
77
Author: HackTheDev
8+
Text Domain: shys-tutorials-handbooks
89
*/
910

11+
if ( ! defined( 'ABSPATH' ) ) exit;
12+
1013
require 'PayPalLibrary.php';
1114

1215
// Function to output meta description based on tutorial's short description
@@ -386,7 +389,7 @@ function thp_access_control_callback($post) {
386389

387390
function thp_save_post($post_id) {
388391
if (isset($_POST['assigned_users'])) {
389-
update_post_meta($post_id, '_assigned_users', $_POST['assigned_users']);
392+
update_post_meta($post_id, '_assigned_users', wp_unslash($_POST['assigned_users']));
390393
} else {
391394
delete_post_meta($post_id, '_assigned_users');
392395
}
@@ -764,7 +767,7 @@ function thp_log_error($message) {
764767
$message = sanitize_text_field($message);
765768

766769
// Add a timestamp to the log message
767-
$timestamp = date('Y-m-d H:i:s');
770+
$timestamp = gmdate('Y-m-d H:i:s');
768771
$log_entry = "{$timestamp} - {$message}";
769772

770773
// Get existing logs, or initialize an empty array if none exist
@@ -860,9 +863,9 @@ function thp_generate_paypal_link($post_id) {
860863

861864
function thp_execute_paypal_payment() {
862865
if (isset($_GET['action']) && $_GET['action'] === 'execute_payment' && isset($_GET['paymentId']) && isset($_GET['PayerID']) && isset($_GET['post_id'])) {
863-
$paymentId = $_GET['paymentId'];
864-
$payerId = $_GET['PayerID'];
865-
$post_id = intval($_GET['post_id']);
866+
$paymentId = wp_unslash($_GET['paymentId']);
867+
$payerId = wp_unslash($_GET['PayerID']);
868+
$post_id = wp_unslash(intval($_GET['post_id']));
866869

867870
$client_id = get_option('thp_paypal_client_id');
868871
$secret = get_option('thp_paypal_secret');

vendor/autoload.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
// autoload.php @generated by Composer
4+
5+
if (PHP_VERSION_ID < 50600) {
6+
if (!headers_sent()) {
7+
header('HTTP/1.1 500 Internal Server Error');
8+
}
9+
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
10+
if (!ini_get('display_errors')) {
11+
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
12+
fwrite(STDERR, $err);
13+
} elseif (!headers_sent()) {
14+
echo $err;
15+
}
16+
}
17+
trigger_error(
18+
$err,
19+
E_USER_ERROR
20+
);
21+
}
22+
23+
require_once __DIR__ . '/composer/autoload_real.php';
24+
25+
return ComposerAutoloaderInitc44053762671f5e67f14e0d2c9f01b33::getLoader();

0 commit comments

Comments
 (0)