fix runtime in older versions of PHP caused by json_last_error_msg

master
Marek Isalski 7 years ago
parent 449e8322d3
commit a024a46b48

@ -151,7 +151,10 @@ function fulcrm_webhook_webhook( $uuid ) {
if ( array_key_exists( 'Content-Type', $headers ) && ( $headers[ 'Content-Type' ] === 'application/json' ) ) {
$payload = json_decode( file_get_contents( "php://input" ), $assoc = TRUE );
$payload_error = json_last_error();
$payload_error_msg = json_last_error_msg();
if ( function_exists( 'json_last_error_msg' ) )
$payload_error_msg = json_last_error_msg();
else
$payload_error_msg = 'JSON error unavailable';
} else {
$payload_error_msg = 'no payload';
}

Loading…
Cancel
Save