@@ -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"); |
@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | function sanitize_output($buffer) { |
| 17 | 17 | |
| 18 | 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 |
|
| 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 | 22 | '/<!--(.|\s)*?-->/' // Remove HTML comments |
| 23 | 23 | ); |
| 24 | 24 | |
@@ -58,13 +58,13 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $debug_backtrace = current(debug_backtrace()); |
| 60 | 60 | if (PHP_SAPI == 'cli') { |
| 61 | - echo 'Dump: ' . $debug_backtrace['file'] . ':' . $debug_backtrace['line'] . "\n"; |
|
| 61 | + echo 'Dump: '.$debug_backtrace['file'].':'.$debug_backtrace['line']."\n"; |
|
| 62 | 62 | foreach (func_get_args() as $data) { |
| 63 | 63 | var_dump($data); |
| 64 | 64 | } |
| 65 | 65 | } else { |
| 66 | 66 | ob_clean(); |
| 67 | - echo '<div>Dump: ' . $debug_backtrace['file'] . ':<b>' . $debug_backtrace['line'] . "</b></div>"; |
|
| 67 | + echo '<div>Dump: '.$debug_backtrace['file'].':<b>'.$debug_backtrace['line']."</b></div>"; |
|
| 68 | 68 | echo '<pre>'; |
| 69 | 69 | foreach (func_get_args() as $data) { |
| 70 | 70 | echo "<code>"; |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | function utf8Convert($array) |
| 114 | 114 | { |
| 115 | - array_walk_recursive($array, function(&$item){ |
|
| 116 | - if(!mb_detect_encoding($item, 'utf-8', true)){ |
|
| 115 | + array_walk_recursive($array, function(&$item) { |
|
| 116 | + if (!mb_detect_encoding($item, 'utf-8', true)) { |
|
| 117 | 117 | $item = utf8_encode($item); |
| 118 | 118 | } |
| 119 | 119 | }); |