From 4d6c9e3e1754d21ea5291207085113e99456f571 Mon Sep 17 00:00:00 2001
From: Lynx Linden <lynx@lindenlab.com>
Date: Fri, 29 Jan 2010 14:30:26 +0000
Subject: EXT-4678: Support <nolink>...</nolink> to turn off URL hyperlinking.

We are running into a bunch of places where we don't want to allow
hyperlinking of URLs like secondlife.com in text boxes. I've therefore
added a new type of URL regex that disables URL hyperlinking. Simply
enclose the URL in a <nolink> tag, e.g.:

  <nolink>secondlife.com</nolink>
---
 indra/llui/tests/llurlentry_test.cpp |  8 ++++++++
 indra/llui/tests/llurlmatch_test.cpp | 30 +++++++++++++++---------------
 2 files changed, 23 insertions(+), 15 deletions(-)

(limited to 'indra/llui/tests')

diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 80be8fcbf7..6fec1d3e10 100644
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -610,5 +610,13 @@ namespace tut
 		testRegex("invalid .net URL", r,
 				  "foo.netty",
 				  "");
+
+		testRegex("XML tags around URL [1]", r,
+				  "<foo>secondlife.com</foo>",
+				  "secondlife.com");
+
+		testRegex("XML tags around URL [2]", r,
+				  "<foo>secondlife.com/status?bar=1</foo>",
+				  "secondlife.com/status?bar=1");
 	}
 }
diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp
index e8cf135346..f9dfee931b 100644
--- a/indra/llui/tests/llurlmatch_test.cpp
+++ b/indra/llui/tests/llurlmatch_test.cpp
@@ -53,7 +53,7 @@ namespace tut
 		LLUrlMatch match;
 		ensure("empty()", match.empty());
 
-		match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLUIColor(), "", "");
+		match.setValues(0, 1, "http://secondlife.com", "Second Life", "", "", LLUIColor(), "", "", false);
 		ensure("! empty()", ! match.empty());
 	}
 
@@ -66,7 +66,7 @@ namespace tut
 		LLUrlMatch match;
 		ensure_equals("getStart() == 0", match.getStart(), 0);
 
-		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
 		ensure_equals("getStart() == 10", match.getStart(), 10);
 	}
 
@@ -79,7 +79,7 @@ namespace tut
 		LLUrlMatch match;
 		ensure_equals("getEnd() == 0", match.getEnd(), 0);
 
-		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
 		ensure_equals("getEnd() == 20", match.getEnd(), 20);
 	}
 
@@ -92,10 +92,10 @@ namespace tut
 		LLUrlMatch match;
 		ensure_equals("getUrl() == ''", match.getUrl(), "");
 
-		match.setValues(10, 20, "http://slurl.com/", "", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "http://slurl.com/", "", "", "", LLUIColor(), "", "", false);
 		ensure_equals("getUrl() == 'http://slurl.com/'", match.getUrl(), "http://slurl.com/");
 
-		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
 		ensure_equals("getUrl() == '' (2)", match.getUrl(), "");
 	}
 
@@ -108,10 +108,10 @@ namespace tut
 		LLUrlMatch match;
 		ensure_equals("getLabel() == ''", match.getLabel(), "");
 
-		match.setValues(10, 20, "", "Label", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "Label", "", "", LLUIColor(), "", "", false);
 		ensure_equals("getLabel() == 'Label'", match.getLabel(), "Label");
 
-		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
 		ensure_equals("getLabel() == '' (2)", match.getLabel(), "");
 	}
 
@@ -124,10 +124,10 @@ namespace tut
 		LLUrlMatch match;
 		ensure_equals("getTooltip() == ''", match.getTooltip(), "");
 
-		match.setValues(10, 20, "", "", "Info", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "Info", "", LLUIColor(), "", "", false);
 		ensure_equals("getTooltip() == 'Info'", match.getTooltip(), "Info");
 
-		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
 		ensure_equals("getTooltip() == '' (2)", match.getTooltip(), "");
 	}
 
@@ -140,10 +140,10 @@ namespace tut
 		LLUrlMatch match;
 		ensure_equals("getIcon() == ''", match.getIcon(), "");
 
-		match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "", "", false);
 		ensure_equals("getIcon() == 'Icon'", match.getIcon(), "Icon");
 
-		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
 		ensure_equals("getIcon() == '' (2)", match.getIcon(), "");
 	}
 
@@ -156,10 +156,10 @@ namespace tut
 		LLUrlMatch match;
 		ensure("getMenuName() empty", match.getMenuName().empty());
 
-		match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "");
+		match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "", false);
 		ensure_equals("getMenuName() == \"xui_file.xml\"", match.getMenuName(), "xui_file.xml");
 
-		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
 		ensure("getMenuName() empty (2)", match.getMenuName().empty());
 	}
 
@@ -172,10 +172,10 @@ namespace tut
 		LLUrlMatch match;
 		ensure("getLocation() empty", match.getLocation().empty());
 
-		match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "Paris");
+		match.setValues(10, 20, "", "", "", "Icon", LLUIColor(), "xui_file.xml", "Paris", false);
 		ensure_equals("getLocation() == \"Paris\"", match.getLocation(), "Paris");
 
-		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "");
+		match.setValues(10, 20, "", "", "", "", LLUIColor(), "", "", false);
 		ensure("getLocation() empty (2)", match.getLocation().empty());
 	}
 }
-- 
cgit v1.2.3


From 4cdb84d6c4302357a52ae5399a2ff9d998dc5779 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Fri, 29 Jan 2010 15:53:14 -0800
Subject: CID-299

Checker: UNINIT_CTOR
Function: LLUIColor::LLUIColor()
File: /indra/llui/tests/llurlmatch_test.cpp
---
 indra/llui/tests/llurlmatch_test.cpp | 1 +
 1 file changed, 1 insertion(+)

(limited to 'indra/llui/tests')

diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp
index f9dfee931b..24a32de268 100644
--- a/indra/llui/tests/llurlmatch_test.cpp
+++ b/indra/llui/tests/llurlmatch_test.cpp
@@ -25,6 +25,7 @@
 
 // link seam
 LLUIColor::LLUIColor()
+	: mColorPtr(NULL)
 {}
 
 namespace tut
-- 
cgit v1.2.3


From ccbf6088b7e383d7da8df40429b05fdb2c7523f6 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Fri, 29 Jan 2010 15:54:24 -0800
Subject: CID-299

Checker: UNINIT_CTOR
Function: LLUIColor::LLUIColor()
File: /indra/llui/tests/llurlentry_test.cpp
---
 indra/llui/tests/llurlentry_test.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/llui/tests')

diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 6fec1d3e10..bc97cf3df2 100644
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -33,7 +33,7 @@ LLUIColor LLUIColorTable::getColor(const std::string& name, const LLColor4& defa
 	return LLUIColor();
 }
 
-LLUIColor::LLUIColor() {}
+LLUIColor::LLUIColor() : mColorPtr(NULL) {}
 
 namespace tut
 {
-- 
cgit v1.2.3