diff --git a/fulcrm_webhook.module b/fulcrm_webhook.module index 0a976ae..7cebe7c 100644 --- a/fulcrm_webhook.module +++ b/fulcrm_webhook.module @@ -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'; }