Created
June 7, 2013 07:36
-
-
Save metbrewster/5727609 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function sanitize_page($buffer) { | |
$search = array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s'); | |
$replace = array('>', '<', '\\1'); | |
$buffer = preg_replace($search, $replace, $buffer); | |
function gzip_doc($buffer) { if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) { return ob_gzhandler($buffer, 5); } else { return $buffer; }} | |
return gzip_doc($buffer); | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment