New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PHP8 compatibility issues #27
base: master
Are you sure you want to change the base?
Conversation
Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a var_dump()
of potentially sensitive data that needs to be removed, and had a few other minor suggestions, but overall good stuff
@@ -72,6 +73,7 @@ function Espresso_PayPal($DataArray) | |||
$this -> NVPCredentials .= $this -> APISubject != '' ? 'SUBJECT=' . $this -> APISubject : ''; | |||
$this -> NVPCredentials .= $this -> APIMode == 'Signature' ? '&SIGNATURE=' . $this -> APISignature : ''; | |||
|
|||
var_dump($this->NVPCredentials); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OOPS!
going to go out on a limb here and say it's maybe not a good thing to dump credentials like this 🤔
gateways/stripe/do_transaction.php
Outdated
if(method_exists($intent, 'toArray')) { | ||
$intent_array = $intent->toArray(true); | ||
} else { | ||
$intent_array = $intent->__toArray(true); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not critical, but it's preferable to use ternaries:
$intent_array = method_exists($intent, 'toArray')
? $intent->toArray(true)
: $intent->__toArray(true);
//var_dump($_POST); | ||
//var_dump($_REQUEST); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe remove?
$multi_reg = FALSE; | ||
$event_id = isset($_POST['event_id']) ? absint( $_POST['event_id'] ) : isset($_REQUEST['event_id']) ? absint( $_REQUEST['event_id'] ) : ''; | ||
$registration_id = isset( $_POST['registration_id'] ) ? sanitize_text_field( $_POST['registration_id'] ) : isset( $_REQUEST['registration_id'] ) ? sanitize_text_field( $_REQUEST['registration_id'] ) : FALSE; | ||
$event_id = isset($_REQUEST['event_id']) ? absint( $_REQUEST['event_id'] ) : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOLZ! MUCH better 💯
'start_date' => !empty($_POST['recurrence_start_date']) ? sanitize_text_field($_POST['recurrence_start_date']) : '0000-00-00', | ||
'event_end_date' => !empty($_POST['recurrence_event_end_date']) ? sanitize_text_field($_POST['recurrence_event_end_date']) : '0000-00-00', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
@@ -399,7 +399,7 @@ private function _requestRaw($method, $url, $params, $headers) | |||
$hasFile | |||
); | |||
|
|||
if (array_key_exists('request-id', $rheaders)) { | |||
if (isset($rheaders['request-id'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subtle but impactful change 👍🏻
…{property} is deprecated notices
This PR just prevents fatal's from PHP8
Swaps out instances of each() for foreach()
Adjusts the parameter order passed to implode()
Updates FPDF to the latest version so its works with PHP8.
Fixes a couple of notices.
Patches the Stripe SDK with a couple of fixes.
Uses the 'new' style constructor within PayPal Pro