summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/publicize.php')
-rw-r--r--plugins/jetpack/modules/publicize.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/jetpack/modules/publicize.php b/plugins/jetpack/modules/publicize.php
index 40b9b604..0b2b8c73 100644
--- a/plugins/jetpack/modules/publicize.php
+++ b/plugins/jetpack/modules/publicize.php
@@ -167,7 +167,12 @@ class Publicize_Util {
$string = mb_convert_encoding( $string, 'HTML-ENTITIES', 'UTF-8' );
$dom = new DOMDocument( '1.0', 'UTF-8' );
- @$dom->loadHTML( "<html><body>$string</body></html>" ); // suppress parser warning
+
+ // The @ is not enough to suppress errors when dealing with libxml,
+ // we have to tell it directly how we want to handle errors.
+ libxml_use_internal_errors( true );
+ @$dom->loadHTML( "<html><body>$string</body></html>" );
+ libxml_use_internal_errors( false );
// Strip comment nodes, if any
$comment_nodes = self::get_comment_nodes( $dom->documentElement );