Repository navigation
MCP for Cloud 1.3.1
Fix release on top of 1.3.0. No database change and no permission change; updating from 1.3.0 needs no step. Only HTML mail drafts (mail_create_draft with html: true) change: they now work on servers with libxml2 2.14 or later (1.3.0 refused them there), a loose & no longer refuses a draft, and some HTML that 1.3.0 accepted on older libxml2 is now refused with the same message on every server, as listed below. Plain-text drafts and every other tool behave as in 1.3.0.
Fixed
- HTML mail drafts were always refused on servers with libxml2 2.14 or later (#30): on Ubuntu 25.10 and 26.04, Debian testing and other systems whose libxml2 parses HTML with the HTML5 tokenizer, every
mail_create_draftcall withhtml: truefailed with "The HTML draft could not be safely parsed and sanitized; nothing was saved." The UTF-8 hint the sanitizer adds before parsing became an extra comment there, which was counted as content removed by the engine. Nothing unsafe was ever saved, but the feature did not work. The hint no longer reaches the sanitizer on any libxml version. Servers with older libxml2 (Ubuntu 24.04, Debian 12 and 13, the official Nextcloud Docker images) were not affected. The newer parser does not wrap bare top-level text in a paragraph, so a draft such as<a>ok</a>is saved asokthere and as<p>ok</p>on older libxml2; both are safe. - HTML that libxml versions read differently is refused on all of them: the newer parser silently recovers constructs the older one reported, such as a repeated attribute or a numeric reference without its semicolon, and it ends comments, raw text and some elements in other places. Instead of following either parser, the sanitizer now accepts only plain HTML that both read alike, and refuses the draft, on every libxml version, when the source contains: a malformed or unclosed comment (for example one ending in
--!>or containing--); any element other than the ones a draft keeps, thehtml,head,body,meta,title,baseandlinkelements, the elements the sanitizer removes (script,style,iframe,object,form,template,noscript,textarea,img) and the elements it unwraps while keeping their content, as in 1.3.0 (font,center,h4,h5,h6,sup,sub,small,mark,abbr,cite,q,ins,kbd,dl,dt,dd,section,article,header,footer,figure,figcaption,acronym,big,strike,tt,samp,var,addressanddfn), so obsolete and unknown elements such asbgsound,svg,math,source,navorcaptionare refused;/>on an element that is not void (onlybr,hr,img,meta,linkandbasemay use it) and an end tag of a void element; attributes not separated by spaces or written with another syntax; a repeated attribute name anywhere, in any letter case; an attribute value that holds<or>, also written as a reference; an end tag with attributes;<that does not start a tag or comment; a script, style, title, textarea, iframe or noscript with markup inside or without its end tag;html,headorbodyrepeated or out of order (htmlmust come before any content,headandbodybefore any body content, andheadmust hold only head elements and be closed), a revealed conditional comment delimiter insidehead, and anything but whitespace after</body>or</html>, which both versions silently dropped while reporting that nothing was removed; control characters other than tab and line break, or noncharacters; and numeric character references without their semicolon or to anything but tab, line feed and visible characters (carriage return, other controls, DEL, C1 controls, surrogates, noncharacters and values beyond Unicode are refused). Before, some of these were removed with a count on older libxml2. Line breaks are saved as line feeds, and whitespace before the first content or after</body>or</html>is dropped. The removal counts no longer report an implied document head that held only whitespace as a removed subtree. - A loose
&no longer refuses an HTML draft: text such as "A & B", "AT&T" or "R&D", and a link such ashttps://example.com/?a=1&b=2, was refused on most servers. An ampersand that starts no character reference is now kept as text (saved as&), so the preview, the link destinations and the saved draft show exactly what was written. A named reference is decoded only with its semicolon and a name every libxml version knows (the HTML 4.01 names and'); any other name, and a name without its semicolon such as© 2026or&, is kept as literal text, as shown in the preview.
Validation and limits
The sanitizer is covered by unit tests run against both HTML parsers: a corpus of drafts and a parity fixture whose cases must give the same result, or the same refusal, on legacy libxml2 and on libxml2 2.14 or later; the only accepted difference is the implied paragraph described above. The Mail HTML draft tests pass on libxml2 2.9.14 (PHP 8.2 to 8.5) and on libxml2 2.15.2 (PHP 8.5, Ubuntu 26.04), and CI now also runs them on Ubuntu 24.04 to keep the legacy parser covered. The full unit suite passes on PHP 8.2, 8.3, 8.4 and 8.5, and an upgrade from 1.3.0 on Nextcloud 35 with PostgreSQL and the optional Deck, Mail, Tables, Forms, Polls and Collectives apps passes the integration suite.
Community feedback
- HTML mail drafts follow the request of @Beluluz in #30; this release makes them work on servers with newer libxml2.
Feedback credits name who requested, reported or suggested a change.