Skip to content

Commit 8817d4c

Browse files
committed
fixed some responses with weird characters #58
1 parent e3a4052 commit 8817d4c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function getHtmlContent()
215215
$content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">', $content);
216216
}
217217

218-
$this->htmlContent->loadHTML($content);
218+
$this->htmlContent->loadHTML(trim($content));
219219

220220
libxml_use_internal_errors($errors);
221221
libxml_disable_entity_loader($entities);

tests/SmQueueTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/**
4+
* This is to test responses html that need to be trimmed before load in the DOMElement
5+
*/
6+
class SmQueue extends TestCaseBase
7+
{
8+
public function testOne()
9+
{
10+
$this->assertEmbed(
11+
'https://www.smqueue.com/registration',
12+
[
13+
'title' => 'Registration',
14+
'image' => 'https://www.smqueue.com/public/images/smqueue-logo-small.png',
15+
]
16+
);
17+
}
18+
}

0 commit comments

Comments
 (0)