Skip to content

Commit 5b04a00

Browse files
authored
Merge pull request #25 from vzhurin/fix_multibyte
Fix problem with multibyte characters in the error message
2 parents 10fb42d + 929b4fd commit 5b04a00

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)