Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function sanitize_output($buffer) {
- $search = array(
- '/\>[^\S ]+/s',
- '/[^\S ]+\</s',
- '/(\s)+/s',
- '/<!--(.|\s)*?-->/'
- );
- $replace = array(
- '>',
- '<',
- '\\1',
- ''
- );
- $buffer = preg_replace($search, $replace, $buffer);
- return $buffer;
- }
- ob_start("sanitize_output");
- header("Content-Type: text/html; charset=utf-8");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement