Skip to content

Commit

Permalink
Fix PHP null exception.
Browse files Browse the repository at this point in the history
Summary:
Issue reported on the Wordpress forum.

https://wordpress.org/support/topic/php-fatal-error-364/

PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /srv/htdocs/wp-content/plugins/official-facebook-pixel/core/FacebookWordpressOpenBridge.php:119

Reviewed By: vahidkay-meta

Differential Revision: D46067579

fbshipit-source-id: 2fc19965631ed01042b58af931d6b975f7c19ce6
  • Loading branch information
Freddy Bisaso authored and facebook-github-bot committed May 22, 2023
1 parent 6069ae5 commit d155011
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion facebook-for-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ public function handle_events_request(){
FacebookPluginConfig::OPEN_BRIDGE_PATH)
&& $_SERVER['REQUEST_METHOD'] == 'POST'){
$data = json_decode(file_get_contents('php://input'), true);
FacebookWordpressOpenBridge::getInstance()->handleOpenBridgeReq($data);
if (!is_null($data)) {
FacebookWordpressOpenBridge::getInstance()->handleOpenBridgeReq($data);
}
exit();
}
}
Expand Down

0 comments on commit d155011

Please sign in to comment.