Commit 6e6df92c authored by Simon Lipp's avatar Simon Lipp Committed by Charles Lindsay
Browse files

Fix crash when getting preview with long html tags

Closes: bgo #726468
parent 1a416226
......@@ -20,6 +20,7 @@ Mathias Hasselmann <mathias@openismus.com>
Timo Kluck <tkluck@infty.nl>
Charles Lehner <rdm.cel@celehner.com>
Avi Levy <avi.w.levy@gmail.com>
Simon Lipp <bugs-gnome@simon.lipp.name>
Brendan Long <self@brendanlong.com>
Angelo Marchesin <marchesin.angelo@gmail.com>
Kai Mast <mail@kai-mast.de>
......
......@@ -124,9 +124,8 @@ public string remove_html_tags(string input) {
Regex style = new Regex("<style[^>]*?>[\\s\\S]*?<\\/style>", RegexCompileFlags.CASELESS);
output = style.replace(output, -1, 0, "");
// Removes remaining tags. Based on this regex:
// http://osherove.com/blog/2003/5/13/strip-html-tags-from-a-string-using-regular-expressions.html
Regex tags = new Regex("<(.|\n)*?>", RegexCompileFlags.CASELESS);
// Removes remaining tags.
Regex tags = new Regex("<[^>]*>", RegexCompileFlags.CASELESS);
return tags.replace(output, -1, 0, "");
} catch (Error e) {
debug("Error stripping HTML tags: %s", e.message);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment