From ef5a6d9bd71d75712d4cb23762afe63a4df19f6f Mon Sep 17 00:00:00 2001 From: Khien Pham Date: Fri, 20 Dec 2024 07:50:10 -0800 Subject: [PATCH] Fix addcslashes(), strpos(): Passing null to parameter #1 ($string) of type string is deprecated (#616) Summary: `Deprecated: addcslashes(): Passing null to parameter https://github.com/facebook/facebook-php-business-sdk/issues/1 ($string) of type string is deprecated {"exception":"[object] (ErrorException(code: 0): Deprecated: addcslashes(): Passing null to parameter https://github.com/facebook/facebook-php-business-sdk/issues/1 ($string) of type string is deprecated at /app/vendor/facebook/php-business-sdk/src/FacebookAds/Logger/CurlLogger.php:160)"} [] Deprecated: strpos(): Passing null to parameter https://github.com/facebook/facebook-php-business-sdk/issues/1 ($haystack) of type string is deprecated {"exception":"[object] (ErrorException(code: 0): Deprecated: strpos(): Passing null to parameter https://github.com/facebook/facebook-php-business-sdk/issues/1 ($haystack) of type string is deprecated at /app/vendor/facebook/php-business-sdk/src/FacebookAds/Logger/CurlLogger.php:161)"} []` Pull Request resolved: https://github.com/facebook/facebook-php-business-sdk/pull/616 Reviewed By: liliarizona Differential Revision: D67467808 Pulled By: stcheng fbshipit-source-id: 39b7f5e24b5b0314fcbaa271169c5c23b3b2afe0 --- src/FacebookAds/Logger/CurlLogger.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/FacebookAds/Logger/CurlLogger.php b/src/FacebookAds/Logger/CurlLogger.php index 6c5052847..5f4292528 100644 --- a/src/FacebookAds/Logger/CurlLogger.php +++ b/src/FacebookAds/Logger/CurlLogger.php @@ -157,6 +157,7 @@ protected function processParams(Parameters $params, $method, $is_file) { if ($is_file && $params->offsetGet($name) instanceof FileParameter) { $value = "@" . $this->normalizeFileParam($params->offsetGet($name)); } else { + $value = (string) $value; $value = addcslashes( strpos($value, "\n") !== false ? $this->indent($value, 2)