Skip to content

Commit 929b4fd

Browse files
author
Zhurin Vasiliy
committed
Fix problem with multibyte characters in the error message
1 parent 10fb42d commit 929b4fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Clients/AbstractMindboxClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ final protected function parseRawResponse(MindboxRequest $request, HttpClientRaw
285285
$body = $context['response']['body'];
286286
$arBody = json_decode($body, true);
287287
if ($arBody) {
288-
$message = substr($arBody['errorMessage'], strpos($arBody['errorMessage'], ":") + 1);
288+
$message = \trim(\array_slice(\explode(':', $arBody['errorMessage'], 2), -1)[0]);
289289
} else {
290290
$message = 'Bad request';
291291
}

0 commit comments

Comments
 (0)