1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

Make newline normalization optional.

This commit is contained in:
Tomasz Muras
2010-09-10 21:51:55 +01:00
committed by Edward Z. Yang
parent 632bf2bbd4
commit 9573f0933d
8 changed files with 42 additions and 8 deletions

View File

@@ -263,8 +263,10 @@ class HTMLPurifier_Lexer
public function normalize($html, $config, $context) {
// normalize newlines to \n
$html = str_replace("\r\n", "\n", $html);
$html = str_replace("\r", "\n", $html);
if ($config->get('HTML.NewlineNormalization')) {
$html = str_replace("\r\n", "\n", $html);
$html = str_replace("\r", "\n", $html);
}
if ($config->get('HTML.Trusted')) {
// escape convoluted CDATA