@@ -15,23 +15,23 @@ |
||
| 15 | 15 | |
| 16 | 16 | function sanitize_output($buffer) { |
| 17 | 17 | |
| 18 | - $search = array( |
|
| 19 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
| 20 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
| 21 | - '/(\s)+/s', // shorten multiple whitespace sequences |
|
| 22 | - '/<!--(.|\s)*?-->/' // Remove HTML comments |
|
| 23 | - ); |
|
| 24 | - |
|
| 25 | - $replace = array( |
|
| 26 | - '>', |
|
| 27 | - '<', |
|
| 28 | - '\\1', |
|
| 29 | - '' |
|
| 30 | - ); |
|
| 31 | - |
|
| 32 | - $buffer = preg_replace($search, $replace, $buffer); |
|
| 33 | - |
|
| 34 | - return $buffer; |
|
| 18 | + $search = array( |
|
| 19 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
| 20 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
| 21 | + '/(\s)+/s', // shorten multiple whitespace sequences |
|
| 22 | + '/<!--(.|\s)*?-->/' // Remove HTML comments |
|
| 23 | + ); |
|
| 24 | + |
|
| 25 | + $replace = array( |
|
| 26 | + '>', |
|
| 27 | + '<', |
|
| 28 | + '\\1', |
|
| 29 | + '' |
|
| 30 | + ); |
|
| 31 | + |
|
| 32 | + $buffer = preg_replace($search, $replace, $buffer); |
|
| 33 | + |
|
| 34 | + return $buffer; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | ob_start("sanitize_output"); |