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

Commit 7d6f09b

Browse files
cebeNaktibalda
authored andcommitted
Fix broken UTF-8 in failure description of Page
1 parent 7a871bd commit 7d6f09b

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
@@ -56,8 +56,8 @@ protected function failureDescription($pageContent)
5656
{
5757
$message = $this->uriMessage('on page');
5858
$message->append("\n--> ");
59-
$message->append(substr($pageContent, 0, 300));
60-
if (strlen($pageContent) > 300) {
59+
$message->append(mb_substr($pageContent, 0, 300, 'utf-8'));
60+
if (mb_strlen($pageContent, 'utf-8') > 300) {
6161
$debugMessage = new Message(
6262
"[Content too long to display. See complete response in '" . codecept_output_dir() . "' directory]"
6363
);

0 commit comments

Comments
 (0)