*/ if (!defined('ABSPATH')) { exit; } class ABTF_HTMLMinify { protected $_jsCleanComments = true; protected $_isXhtml = null; protected $_replacementHash = null; protected $_placeholders = array(); final public function __construct() { // set replacement hash $this->_replacementHash = 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']); } /** * Minify HTML * * @param string $HTML HTML string to minify. * @return string Minified HTML. */ final public function minify($HTML) { if ($this->_isXhtml === null) { $this->_isXhtml = (false !== strpos($HTML, '_placeholders), array_values($this->_placeholders), $HTML ); // issue 229: multi-pass to catch scripts that didn't get replaced in textareas $HTML = str_replace( array_keys($this->_placeholders), array_values($this->_placeholders), $HTML ); return $HTML; } public function _reservePlace($content) { $placeholder = '%' . $this->_replacementHash . count($this->_placeholders) . '%'; $this->_placeholders[$placeholder] = $content; return $placeholder; } public function _removePreCB($m) { return $this->_reservePlace("
_reservePlace("