| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/ict/wp-content/plugins/w3-total-cache/lib/Minify/Minify/ |
Upload File : |
<?php
namespace W3TCL\Minify;
class Minify_HTMLTidy {
public static function minify($content, $options = array()) {
$options = array_merge(array(
'clean' => false,
'hide-comments' => true,
'wrap' => 0,
'input-encoding' => 'utf8',
'output-encoding' => 'utf8',
'preserve-entities' => true
), $options, array(
'show-errors' => 0,
'show-warnings' => false,
'force-output' => true,
'tidy-mark' => false,
'output-xhtml' => false,
));
$tidy = new \tidy();
$tidy->parseString($content, $options);
$tidy->cleanRepair();
$content = $tidy->value;
return $content;
}
public static function minifyXhtml($html, $options = array()) {
$options = array_merge($options, array(
'output-xhtml' => true
));
return self::minify($html, $options);
}
public static function minifyXml($xml, $options = array()) {
$options = array_merge($options, array(
'input-xml' => true,
'output-xml' => true,
'add-xml-decl' => true
));
return self::minify($xml, $options);
}
}