diff --git a/htdocs/core/class/HtmlToOdtConverter.class.php b/htdocs/core/class/HtmlToOdtConverter.class.php
index d074c7f7a9b..3df9d3cb3af 100644
--- a/htdocs/core/class/HtmlToOdtConverter.class.php
+++ b/htdocs/core/class/HtmlToOdtConverter.class.php
@@ -77,6 +77,7 @@ class HtmlToOdtConverter {
$odtResult .= '' . ($tag['children'] != null ? self::replaceHtmlWithOdtTag($tag['children'], $customStyles) : $tag['innerText']) . '';
break;
case 'i':
+ case 'em':
$odtResult .= '' . ($tag['children'] != null ? self::replaceHtmlWithOdtTag($tag['children'], $customStyles) : $tag['innerText']) . '';
break;
case 'u':
@@ -144,7 +145,8 @@ class HtmlToOdtConverter {
* @param string $text The text to check
*/
public static function hasHtmlTag($text) {
- return preg_match_all(HTML_REGEX_PATTERN, $text);
+ $result = preg_match_all(HTML_REGEX_PATTERN, $text);
+ return is_numeric($result) && $result > 0;
}
/**
diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php
index d42e4133b00..e81e670c253 100644
--- a/htdocs/includes/odtphp/odf.php
+++ b/htdocs/includes/odtphp/odf.php
@@ -1,7 +1,7 @@