Skip to content

Commit 6c01134

Browse files
authored
preg_replace third arg cannot be null (#811)
1 parent 4e631a2 commit 6c01134

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: app/code/Meta/BusinessExtension/Helper/GraphAPIAdapter.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ private function callApi($method, $endpoint, $request)
205205
$logResponse = preg_replace(
206206
'/access_token=([a-z0-9A-Z]+)(?=[a-zA-Z0-9]{4,})/',
207207
'access_token=XXXXXXX',
208-
$logResponse
208+
$logResponse ?? ''
209209
);
210210
$logResponse = preg_replace(
211211
'/access_token\":\"([a-z0-9A-Z]+)(?=[a-zA-Z0-9]{4,})/',
212212
'access_token":"XXXXXXX',
213-
$logResponse
213+
$logResponse ?? ''
214214
);
215215

216216
$this->logger->debug(

Diff for: app/code/Meta/Catalog/Model/Product/Feed/Builder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ private function getDescription(Product $product)
402402
$description = html_entity_decode(preg_replace(
403403
'/<\s*style.+?<\s*\/\s*style.*?>/',
404404
'',
405-
$description
405+
$description ?? ''
406406
));
407407
// phpcs:ignore
408408
$description = html_entity_decode(preg_replace('/<[^<]+?>/', '', $description));
@@ -439,7 +439,7 @@ private function getRichDescription(Product $product)
439439
$description = html_entity_decode(preg_replace(
440440
'/<\s*style.+?<\s*\/\s*style.*?>/',
441441
'',
442-
$description
442+
$description ?? ''
443443
));
444444

445445
return $this->trimAttribute(

0 commit comments

Comments
 (0)