[gmime] Fixed the text-to-html filtering logic to include non-ascii characters in URLs
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime] Fixed the text-to-html filtering logic to include non-ascii characters in URLs
- Date: Sat, 11 Apr 2015 22:46:01 +0000 (UTC)
commit c1135b0ab233c48eec3911a439a1d13b545c4008
Author: Jeffrey Stedfast <jeff xamarin com>
Date: Sat Apr 11 18:44:29 2015 -0400
Fixed the text-to-html filtering logic to include non-ascii characters in URLs
2015-04-11 Jeffrey Stedfast <fejj gnome org>
* util/url-scanner.c (url_scanner_table_init): Treat all character
values >= 128 as url-safe. Fixes bug #738583.
ChangeLog | 5 +++++
util/url-scanner.c | 24 +++++++++++++-----------
2 files changed, 18 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b749a09..a194b53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-11 Jeffrey Stedfast <fejj gnome org>
+
+ * util/url-scanner.c (url_scanner_table_init): Treat all character
+ values >= 128 as url-safe. Fixes bug #738583.
+
2014-07-18 Jeffrey Stedfast <fejj gnome org>
* gmime/gmime-header.c (g_mime_header_list_register_writer):
diff --git a/util/url-scanner.c b/util/url-scanner.c
index 20535ef..a942801 100644
--- a/util/url-scanner.c
+++ b/util/url-scanner.c
@@ -109,14 +109,14 @@ static unsigned char url_scanner_table[256] = {
66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,160,160,160,128,128,
128, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,
66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66,128,128,128,128, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
+ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
+ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
+ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
+ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
+ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
+ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,
+ 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128
};
enum {
@@ -525,12 +525,12 @@ url_web_end (const char *in, const char *pos, const char *inend, urlmatch_t *mat
static void
-table_init_bits (unsigned int mask, const unsigned char *vals)
+table_init_bits (unsigned int mask, const char *vals)
{
int i;
for (i = 0; vals[i] != '\0'; i++)
- url_scanner_table[vals[i]] |= mask;
+ url_scanner_table[(unsigned char) vals[i]] |= mask;
}
static void
@@ -546,7 +546,9 @@ url_scanner_table_init (void)
url_scanner_table[i] |= IS_DIGIT | IS_DOMAIN;
if ((i >= 'a' && i <= 'z') || (i >= 'A' && i <= 'Z'))
url_scanner_table[i] |= IS_ALPHA | IS_DOMAIN;
- if (i >= 127)
+ if (i >= 128)
+ url_scaller_table[i] |= IS_URLSAFE;
+ if (i == 127)
url_scanner_table[i] |= IS_CTRL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]