Skip to content

Commit

Permalink
Fix addcslashes(), strpos(): Passing null to parameter #1 ($string) o…
Browse files Browse the repository at this point in the history
…f type string is deprecated

Summary:
`Deprecated: addcslashes(): Passing null to parameter facebook/facebook-php-business-sdk#1 ($string) of type string is deprecated {"exception":"[object] (ErrorException(code: 0): Deprecated: addcslashes(): Passing null to parameter facebook/facebook-php-business-sdk#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 facebook/facebook-php-business-sdk#1 ($haystack) of type string is deprecated {"exception":"[object] (ErrorException(code: 0): Deprecated: strpos(): Passing null to parameter facebook/facebook-php-business-sdk#1 ($haystack) of type string is deprecated at /app/vendor/facebook/php-business-sdk/src/FacebookAds/Logger/CurlLogger.php:161)"} []`

X-link: facebook/facebook-php-business-sdk#616

Reviewed By: liliarizona

Differential Revision: D67467808

Pulled By: stcheng

fbshipit-source-id: 39b7f5e24b5b0314fcbaa271169c5c23b3b2afe0
  • Loading branch information
mbvb1223 authored and facebook-github-bot committed Dec 20, 2024
1 parent 61767e0 commit 53550bf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions templates/php/src/FacebookAds/Logger/CurlLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 53550bf

Please sign in to comment.