Skip to content

Commit c85153e

Browse files
committed
remove all mb_string functions
1 parent de75904 commit c85153e

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

src/Html.php

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,19 @@
33
namespace Proxy;
44

55
class Html {
6-
7-
/*
8-
9-
$outputSource = preg_replace("/><\/(area|base|br|col|command|embed|hr|img|input|link|meta|param|source)>/", " />", $outputSource);
10-
11-
$html = mb_eregi_replace("<!\[CDATA\[(.*?)\]\]>", '', $html);
12-
13-
// remove white space before closing tags
14-
$html = mb_eregi_replace("'\s+>", "'>", $html);
15-
$html = mb_eregi_replace('"\s+>', '">', $html);
16-
17-
*/
18-
6+
197
public static function remove_scripts($html){
20-
21-
$html = mb_eregi_replace("<\s*script[^>]*[^/]>(.*?)<\s*/\s*script\s*>", '', $html);
22-
$html = mb_eregi_replace("<\s*script\s*>(.*?)<\s*/\s*script\s*>", '', $html);
23-
8+
$html = preg_replace('/<\s*script[^>]*>(.*?)<\s*\/\s*script\s*>/is', '', $html);
249
return $html;
2510
}
2611

2712
public static function remove_styles($html){
28-
29-
$html = mb_eregi_replace("<\s*style[^>]*[^/]>(.*?)<\s*/\s*style\s*>", '', $html);
30-
$html = mb_eregi_replace("<\s*style\s*>(.*?)<\s*/\s*style\s*>", '', $html);
31-
13+
$html = preg_replace('/<\s*style[^>]*>(.*?)<\s*\/\s*style\s*>/is', '', $html);
3214
return $html;
3315
}
3416

3517
public static function remove_comments($html){
36-
return mb_eregi_replace("<!--(.*?)-->", '', $html);
18+
return preg_replace('/<!--(.*?)-->/s', '', $html);
3719
}
3820

3921
private static function find($selector, $html, $start_from = 0){

0 commit comments

Comments
 (0)