Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wpforms-.../vendor_p.../stripe/stripe-p.../lib
File: Webhook.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace WPForms\Vendor\Stripe;
[2] Fix | Delete
[3] Fix | Delete
abstract class Webhook
[4] Fix | Delete
{
[5] Fix | Delete
const DEFAULT_TOLERANCE = 300;
[6] Fix | Delete
/**
[7] Fix | Delete
* Returns an Event instance using the provided JSON payload. Throws an
[8] Fix | Delete
* Exception\UnexpectedValueException if the payload is not valid JSON, and
[9] Fix | Delete
* an Exception\SignatureVerificationException if the signature
[10] Fix | Delete
* verification fails for any reason.
[11] Fix | Delete
*
[12] Fix | Delete
* @param string $payload the payload sent by Stripe
[13] Fix | Delete
* @param string $sigHeader the contents of the signature header sent by
[14] Fix | Delete
* Stripe
[15] Fix | Delete
* @param string $secret secret used to generate the signature
[16] Fix | Delete
* @param int $tolerance maximum difference allowed between the header's
[17] Fix | Delete
* timestamp and the current time
[18] Fix | Delete
*
[19] Fix | Delete
* @throws Exception\UnexpectedValueException if the payload is not valid JSON,
[20] Fix | Delete
* @throws Exception\SignatureVerificationException if the verification fails
[21] Fix | Delete
*
[22] Fix | Delete
* @return Event the Event instance
[23] Fix | Delete
*/
[24] Fix | Delete
public static function constructEvent($payload, $sigHeader, $secret, $tolerance = self::DEFAULT_TOLERANCE)
[25] Fix | Delete
{
[26] Fix | Delete
WebhookSignature::verifyHeader($payload, $sigHeader, $secret, $tolerance);
[27] Fix | Delete
$data = \json_decode($payload, \true);
[28] Fix | Delete
$jsonError = \json_last_error();
[29] Fix | Delete
if (null === $data && \JSON_ERROR_NONE !== $jsonError) {
[30] Fix | Delete
$msg = "Invalid payload: {$payload} " . "(json_last_error() was {$jsonError})";
[31] Fix | Delete
throw new Exception\UnexpectedValueException($msg);
[32] Fix | Delete
}
[33] Fix | Delete
return Event::constructFrom($data);
[34] Fix | Delete
}
[35] Fix | Delete
}
[36] Fix | Delete
[37] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function