diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-09-30 11:35:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-30 11:35:57 +0200 |
commit | c3fca560b624588d37508142ab73573caf467573 (patch) | |
tree | c02c33b6db135b5e23c36bd4950b656dd3e125c2 /tests | |
parent | 769a28833b68f4c629c5578348b31d51016fbf6f (diff) | |
parent | 1ea09a1b8b8b7f68ec8c7ef069393ee58a0e623a (diff) | |
download | Shaarli-c3fca560b624588d37508142ab73573caf467573.tar.gz Shaarli-c3fca560b624588d37508142ab73573caf467573.tar.zst Shaarli-c3fca560b624588d37508142ab73573caf467573.zip |
Merge pull request #1569 from ArthurHoaro/fix/bad-encoding
Fix warning if the encoding retrieved from external headers is invalid
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bookmark/LinkUtilsTest.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/bookmark/LinkUtilsTest.php b/tests/bookmark/LinkUtilsTest.php index 7d4a7b89..0d07897b 100644 --- a/tests/bookmark/LinkUtilsTest.php +++ b/tests/bookmark/LinkUtilsTest.php | |||
@@ -43,6 +43,19 @@ class LinkUtilsTest extends TestCase | |||
43 | } | 43 | } |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * Test headers_extract_charset() when the charset is found with odd quotes. | ||
47 | */ | ||
48 | public function testHeadersExtractExistentCharsetWithQuotes() | ||
49 | { | ||
50 | $charset = 'x-MacCroatian'; | ||
51 | $headers = 'text/html; charset="' . $charset . '"otherstuff="test"'; | ||
52 | $this->assertEquals(strtolower($charset), header_extract_charset($headers)); | ||
53 | |||
54 | $headers = 'text/html; charset=\'' . $charset . '\'otherstuff="test"'; | ||
55 | $this->assertEquals(strtolower($charset), header_extract_charset($headers)); | ||
56 | } | ||
57 | |||
58 | /** | ||
46 | * Test headers_extract_charset() when the charset is not found. | 59 | * Test headers_extract_charset() when the charset is not found. |
47 | */ | 60 | */ |
48 | public function testHeadersExtractNonExistentCharset() | 61 | public function testHeadersExtractNonExistentCharset() |