[smuxi: 2/4] Engine(-Tests): fixed parsing URLs with [] in query string
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi: 2/4] Engine(-Tests): fixed parsing URLs with [] in query string
- Date: Fri, 30 Jan 2015 23:32:09 +0000 (UTC)
commit 44b1fbc70725e40bfef236ac36fb7458274aa4d8
Author: Mirco Bauer <meebey meebey net>
Date: Thu Jan 29 00:00:41 2015 +0100
Engine(-Tests): fixed parsing URLs with [] in query string
This is against RFC AFAIK but browsers and other URL representations accept and
show [] in the query string like this:
http://www.test.de/bilder.html?data[meta_id]=13895&data[bild_id]=7
src/Engine-Tests/MessageBuilderTests.cs | 6 ++++++
src/Engine/Config/MessageBuilderSettings.cs | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/Engine-Tests/MessageBuilderTests.cs b/src/Engine-Tests/MessageBuilderTests.cs
index 8c9fbdf..354f6a5 100644
--- a/src/Engine-Tests/MessageBuilderTests.cs
+++ b/src/Engine-Tests/MessageBuilderTests.cs
@@ -559,6 +559,12 @@ namespace Smuxi.Engine
builder.TimeStamp = DateTime.MinValue;
builder.Append(new
UrlMessagePartModel("https://web.archive.org/web/20050208144213/http://www.jaganelli.de/"));
TestMessage(msg, builder.ToMessage());
+
+ msg = "http://www.test.de/bilder.html?data[meta_id]=13895&data[bild_id]=7";
+ builder = new MessageBuilder();
+ builder.TimeStamp = DateTime.MinValue;
+ builder.Append(new
UrlMessagePartModel("http://www.test.de/bilder.html?data[meta_id]=13895&data[bild_id]=7"));
+ TestMessage(msg, builder.ToMessage());
}
[Test]
diff --git a/src/Engine/Config/MessageBuilderSettings.cs b/src/Engine/Config/MessageBuilderSettings.cs
index 3e65bdd..5d36fc4 100644
--- a/src/Engine/Config/MessageBuilderSettings.cs
+++ b/src/Engine/Config/MessageBuilderSettings.cs
@@ -70,7 +70,7 @@ namespace Smuxi.Engine
static void InitBuiltinSmartLinks()
{
string path_last_chars = @"a-zA-Z0-9#/%&@=\-_+;:~'";
- string path_chars = path_last_chars + @")(?!.,";
+ string path_chars = path_last_chars + @"\(\)\[\]?!.,";
string domainchars = @"[a-z0-9\-]+";
string subdomain = domainchars + @"\.";
string common_tld = @"de|es|im|us|com|net|org|info|biz|gov|name|edu|onion|museum";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]