[evolution] Change URL and e-mail pattern regular expressions



commit 41630182352eece73fb0d9185e01e6c38ae4f713
Author: Milan Crha <mcrha redhat com>
Date:   Tue Sep 6 18:37:43 2016 +0200

    Change URL and e-mail pattern regular expressions
    
    The evolution could crash when replying to an HTML message inside pcre
    library recursion, which could cause stack overflow.
    
    This had been reported downstream at:
    https://bugzilla.redhat.com/show_bug.cgi?id=1370514

 .../web-extension/e-editor-dom-functions.h         |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.h 
b/modules/webkit-editor/web-extension/e-editor-dom-functions.h
index 67481f1..8ea0982 100644
--- a/modules/webkit-editor/web-extension/e-editor-dom-functions.h
+++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.h
@@ -27,8 +27,8 @@
 
 /* stephenhay from https://mathiasbynens.be/demo/url-regex */
 #define URL_PROTOCOLS "news|telnet|nntp|file|https?|s?ftp|webcal|localhost|ssh"
-#define URL_PATTERN_BASE "(?=((?:(?:(?:" URL_PROTOCOLS 
")\\:\\/\\/)|(?:www\\.|ftp\\.))[^\\s\\/\\$\\.\\?#].[^\\s]*)"
-#define URL_PATTERN_NO_NBSP ")((?:(?!&nbsp;).)*)"
+#define URL_PATTERN_BASE "(?=((?:(?:(?:" URL_PROTOCOLS 
")\\:\\/\\/)|(?:www\\.|ftp\\.))[^\\s\\/\\$\\.\\?#].[^\\s]*+)"
+#define URL_PATTERN_NO_NBSP ")((?:(?!&nbsp;).)*+)"
 #define URL_PATTERN URL_PATTERN_BASE URL_PATTERN_NO_NBSP
 #define URL_PATTERN_SPACE URL_PATTERN_BASE "\\s$" URL_PATTERN_NO_NBSP
 /* Taken from camel-url-scanner.c */
@@ -37,7 +37,7 @@
 /* http://www.w3.org/TR/html5/forms.html#valid-e-mail-address */
 #define E_MAIL_PATTERN \
        "[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}"\
-       "[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*"
+       "[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*+"
 
 #define E_MAIL_PATTERN_SPACE E_MAIL_PATTERN "\\s"
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]