[geary] Fix crash when getting preview with long html tags
- From: Charles Lindsay <clindsay src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Fix crash when getting preview with long html tags
- Date: Mon, 17 Mar 2014 19:40:46 +0000 (UTC)
commit 6e6df92c0501ec8801487fdaab2ba0334a7d7a80
Author: Simon Lipp <bugs-gnome simon lipp name>
Date: Mon Mar 17 12:39:08 2014 -0700
Fix crash when getting preview with long html tags
Closes: bgo #726468
THANKS | 1 +
src/engine/util/util-html.vala | 5 ++---
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/THANKS b/THANKS
index 5c2228c..8d266e1 100644
--- a/THANKS
+++ b/THANKS
@@ -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>
diff --git a/src/engine/util/util-html.vala b/src/engine/util/util-html.vala
index dc0b390..cab2c68 100644
--- a/src/engine/util/util-html.vala
+++ b/src/engine/util/util-html.vala
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]