Skip to content

Commit 24f49f4

Browse files
committed
Drop ext-libxml requirement
Fixes #174
1 parent 9227822 commit 24f49f4

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"require" : {
2323
"ext-ctype": "*",
2424
"ext-dom": "*",
25-
"ext-libxml" : "*",
2625
"php" : ">=5.3.0"
2726
},
2827
"require-dev": {

src/HTML5/Parser/UTF8Utils.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class UTF8Utils
3838

3939
/**
4040
* Count the number of characters in a string.
41-
* UTF-8 aware. This will try (in order) iconv, MB, libxml, and finally a custom counter.
41+
* UTF-8 aware. This will try (in order) iconv, MB, and finally a custom counter.
4242
*
4343
* @param string $string
4444
*
@@ -55,12 +55,6 @@ public static function countChars($string)
5555
return iconv_strlen($string, 'utf-8');
5656
}
5757

58-
if (function_exists('utf8_decode')) {
59-
// MPB: Will this work? Won't certain decodes lead to two chars
60-
// extrapolated out of 2-byte chars?
61-
return strlen(utf8_decode($string));
62-
}
63-
6458
$count = count_chars($string);
6559

6660
// 0x80 = 0x7F - 0 + 1 (one added to get inclusive range)

0 commit comments

Comments
 (0)