Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 11ea88e

Browse files
cebeNaktibalda
authored andcommitted
Fix broken UTF-8 in failure description of Page
1 parent bb0925f commit 11ea88e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Constraint/Page.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ protected function failureDescription($pageContent) : string
5555
{
5656
$message = $this->uriMessage('on page');
5757
$message->append("\n--> ");
58-
$message->append(substr($pageContent, 0, 300));
59-
if (strlen($pageContent) > 300) {
58+
$message->append(mb_substr($pageContent, 0, 300, 'utf-8'));
59+
if (mb_strlen($pageContent, 'utf-8') > 300) {
6060
$debugMessage = new Message(
6161
"[Content too long to display. See complete response in '" . codecept_output_dir() . "' directory]"
6262
);

0 commit comments

Comments
 (0)