diff --git a/core/htmlsanitizer.class.inc.php b/core/htmlsanitizer.class.inc.php
index 59be21623..9220a7d13 100644
--- a/core/htmlsanitizer.class.inc.php
+++ b/core/htmlsanitizer.class.inc.php
@@ -272,6 +272,8 @@ class HTMLDOMSanitizer extends HTMLSanitizer
// Unfortunately, DOMDocument::loadHTML does not take the tag namespaces into account (once loaded there is no way to know if the tag did have a namespace)
// therefore we have to do the transformation upfront
$sHTML = preg_replace('@
', $sHTML);
+ // Replace badly encoded non breaking space
+ $sHTML = preg_replace('~\xc2\xa0~', ' ', $sHTML);
@$this->oDoc->loadHTML(''.$sHTML); // For loading HTML chunks where the character set is not specified
@@ -395,4 +397,4 @@ class HTMLDOMSanitizer extends HTMLSanitizer
}
return true;
}
-}
\ No newline at end of file
+}
diff --git a/test/core/HTMLDOMSanitizerTest.php b/test/core/HTMLDOMSanitizerTest.php
new file mode 100644
index 000000000..73d4c4e79
--- /dev/null
+++ b/test/core/HTMLDOMSanitizerTest.php
@@ -0,0 +1,165 @@
+DoSanitize($sHTML);
+
+ $this->debug($sRes);
+ $this->assertEquals('
Test mit nur Unterschrift
+Kein bild
++
+
Christel Dedman
++
Financial Reporting Manager | G4S International Logistics (Germany) GmbH
++
+
Rathenaustrasse 53, 63263 Neu
+Test mit nur Unterschrift
Kein bild
Christel Dedman
Financial Reporting Manager | G4S International Logistics (Germany) GmbH
Rathenaustrasse 53, 63263 Neu – Isenburg, Office Tel: +49 (0) 6102 / 4393 623 | Fax: +49 (0) 6102 / 4393 619 | Mobile: +49 (0) 172 / 5687367
Email: christel.dedman@g4si.com | Web site: www.g4si.com / www.g4s.com
Disclaimer: G4S International Logistics (G4Si) is a division of the G4S plc group of companies. This communication contains information which may be confidential, personal and/or privileged. It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited. Any personal views expressed in this e-mail are those of the individual sender and G4Si does not endorse or accept responsibility for them. Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity.
Test mit nur Unterschrift
Kein bild
Christel Dedman
Financial Reporting Manager | G4S International Logistics (Germany) GmbH
Rathenaustrasse 53, 63263 Neu – Isenburg, Office Tel: +49 (0) 6102 / 4393 623 | Fax: +49 (0) 6102 / 4393 619 | Mobile: +49 (0) 172 / 5687367
Email: christel.dedman@g4si.com | Web site: www.g4si.com / www.g4s.com
Disclaimer: G4S International Logistics (G4Si) is a division of the G4S plc group of companies. This communication contains information which may be confidential, personal and/or privileged. It is for the exclusive use of the intended recipient(s).
If you are not the intended recipient(s), please note that any distribution, forwarding, copying or use of this communication or the information in it is strictly prohibited. Any personal views expressed in this e-mail are those of the individual sender and G4Si does not endorse or accept responsibility for them. Prior to taking any action based upon this e-mail message, you should seek appropriate confirmation of its authenticity.