| @@ 195-215 (lines=21) @@ | ||
| 192 | return $this->_reservePlace("<textarea{$m[1]}");
|
|
| 193 | } |
|
| 194 | ||
| 195 | protected function _removeStyleCB($m) |
|
| 196 | {
|
|
| 197 | $openStyle = "<style{$m[1]}";
|
|
| 198 | $css = $m[2]; |
|
| 199 | // remove HTML comments |
|
| 200 | $css = preg_replace('/(?:^\\s*<!--|-->\\s*$)/', '', $css);
|
|
| 201 | ||
| 202 | // remove CDATA section markers |
|
| 203 | $css = $this->_removeCdata($css); |
|
| 204 | ||
| 205 | // minify |
|
| 206 | $minifier = $this->_cssMinifier |
|
| 207 | ? $this->_cssMinifier |
|
| 208 | : 'trim'; |
|
| 209 | $css = call_user_func($minifier, $css); |
|
| 210 | ||
| 211 | return $this->_reservePlace($this->_needsCdata($css) |
|
| 212 | ? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>"
|
|
| 213 | : "{$openStyle}{$css}</style>"
|
|
| 214 | ); |
|
| 215 | } |
|
| 216 | ||
| 217 | protected function _removeScriptCB($m) |
|
| 218 | {
|
|
| @@ 208-228 (lines=21) @@ | ||
| 205 | return $this->_reservePlace($m[1]); |
|
| 206 | } |
|
| 207 | ||
| 208 | protected function _removeStyleCB($m) |
|
| 209 | { |
|
| 210 | $openStyle = $m[1]; |
|
| 211 | $css = $m[2]; |
|
| 212 | // remove HTML comments |
|
| 213 | $css = preg_replace('/(?:^\\s*<!--|-->\\s*$)/', '', $css); |
|
| 214 | ||
| 215 | // remove CDATA section markers |
|
| 216 | $css = $this->_removeCdata($css); |
|
| 217 | ||
| 218 | // minify |
|
| 219 | $minifier = $this->_cssMinifier |
|
| 220 | ? $this->_cssMinifier |
|
| 221 | : 'trim'; |
|
| 222 | $css = call_user_func($minifier, $css); |
|
| 223 | ||
| 224 | return $this->_reservePlace($this->_needsCdata($css) |
|
| 225 | ? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>" |
|
| 226 | : "{$openStyle}{$css}</style>" |
|
| 227 | ); |
|
| 228 | } |
|
| 229 | ||
| 230 | protected function _removeScriptCB($m) |
|
| 231 | { |
|