diff options
-rw-r--r-- | linden/indra/llui/lltexteditor.cpp | 28 | ||||
-rw-r--r-- | linden/indra/newview/llurldispatcher.cpp | 30 |
2 files changed, 53 insertions, 5 deletions
diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index de05872..c8ca5bf 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp | |||
@@ -5119,7 +5119,7 @@ S32 LLTextEditor::findHTMLToken(const std::string &line, S32 pos, BOOL reverse) | |||
5119 | BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end, std::string& url) const | 5119 | BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end, std::string& url) const |
5120 | { | 5120 | { |
5121 | 5121 | ||
5122 | S32 m1,m2,m3; | 5122 | S32 m1,m2,m3,m4; |
5123 | BOOL matched = FALSE; | 5123 | BOOL matched = FALSE; |
5124 | 5124 | ||
5125 | m1=line.find("://",*end); | 5125 | m1=line.find("://",*end); |
@@ -5132,10 +5132,11 @@ BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end, std:: | |||
5132 | //Load_url only handles http and https so don't hilite ftp, smb, etc. | 5132 | //Load_url only handles http and https so don't hilite ftp, smb, etc. |
5133 | m2 = line.substr(*begin,(m1 - *begin)).find("http"); | 5133 | m2 = line.substr(*begin,(m1 - *begin)).find("http"); |
5134 | m3 = line.substr(*begin,(m1 - *begin)).find("secondlife"); | 5134 | m3 = line.substr(*begin,(m1 - *begin)).find("secondlife"); |
5135 | m4 = line.substr(*begin,(m1 - *begin)).find("inworldz"); | ||
5135 | 5136 | ||
5136 | std::string badneighbors=".,<>?';\"][}{=-+_)(*&^%$#@!~`\t\r\n\\"; | 5137 | std::string badneighbors=".,<>?';\"][}{=-+_)(*&^%$#@!~`\t\r\n\\"; |
5137 | 5138 | ||
5138 | if (m2 >= 0 || m3>=0) | 5139 | if (m2 >= 0 || m3>=0 || m4>=0) |
5139 | { | 5140 | { |
5140 | S32 bn = badneighbors.find(line.substr(m1+3,1)); | 5141 | S32 bn = badneighbors.find(line.substr(m1+3,1)); |
5141 | 5142 | ||
@@ -5179,9 +5180,28 @@ BOOL LLTextEditor::findHTML(const std::string &line, S32 *begin, S32 *end, std:: | |||
5179 | try | 5180 | try |
5180 | { | 5181 | { |
5181 | url = line.substr(*begin,*end - *begin); | 5182 | url = line.substr(*begin,*end - *begin); |
5182 | std::string slurlID = "slurl.com/secondlife/"; | ||
5183 | strpos = url.find(slurlID); | ||
5184 | 5183 | ||
5184 | // see if it's an izurl | ||
5185 | std::string slurlID = "places.inworldz.com/"; | ||
5186 | strpos = url.find(slurlID); | ||
5187 | if (strpos < 0) | ||
5188 | { | ||
5189 | slurlID="inworldz://"; | ||
5190 | strpos = url.find(slurlID); | ||
5191 | } | ||
5192 | if (strpos < 0) | ||
5193 | { | ||
5194 | slurlID="iz://"; | ||
5195 | strpos = url.find(slurlID); | ||
5196 | } | ||
5197 | |||
5198 | // see if it's an slurl | ||
5199 | if (strpos < 0) | ||
5200 | { | ||
5201 | slurlID = "slurl.com/secondlife/"; | ||
5202 | strpos = url.find(slurlID); | ||
5203 | } | ||
5204 | |||
5185 | if (strpos < 0) | 5205 | if (strpos < 0) |
5186 | { | 5206 | { |
5187 | slurlID="maps.secondlife.com/secondlife/"; | 5207 | slurlID="maps.secondlife.com/secondlife/"; |
diff --git a/linden/indra/newview/llurldispatcher.cpp b/linden/indra/newview/llurldispatcher.cpp index 1144c58..460ffb2 100644 --- a/linden/indra/newview/llurldispatcher.cpp +++ b/linden/indra/newview/llurldispatcher.cpp | |||
@@ -55,6 +55,11 @@ const std::string SLURL_SECONDLIFE_PREFIX = "secondlife://"; | |||
55 | const std::string SLURL_SLURL_PREFIX = "http://slurl.com/secondlife/"; | 55 | const std::string SLURL_SLURL_PREFIX = "http://slurl.com/secondlife/"; |
56 | const std::string SLURL_SLURL_ALT_PREFIX = "http://maps.secondlife.com/secondlife/"; | 56 | const std::string SLURL_SLURL_ALT_PREFIX = "http://maps.secondlife.com/secondlife/"; |
57 | 57 | ||
58 | const std::string IZURL_IZ_HELP_PREFIX = "inworldz://app."; | ||
59 | const std::string IZURL_IZ_PREFIX = "iz://"; | ||
60 | const std::string IZURL_INWORLDZ_PREFIX = "inworldz://"; | ||
61 | const std::string IZURL_IZURL_PREFIX = "http://places.inworldz.com/"; | ||
62 | |||
58 | const std::string SLURL_APP_TOKEN = "app/"; | 63 | const std::string SLURL_APP_TOKEN = "app/"; |
59 | 64 | ||
60 | class LLURLDispatcherImpl | 65 | class LLURLDispatcherImpl |
@@ -119,6 +124,10 @@ bool LLURLDispatcherImpl::isSLURL(const std::string& url) | |||
119 | if (matchPrefix(url, SLURL_SECONDLIFE_PREFIX)) return true; | 124 | if (matchPrefix(url, SLURL_SECONDLIFE_PREFIX)) return true; |
120 | if (matchPrefix(url, SLURL_SLURL_PREFIX)) return true; | 125 | if (matchPrefix(url, SLURL_SLURL_PREFIX)) return true; |
121 | if (matchPrefix(url, SLURL_SLURL_ALT_PREFIX)) return true; | 126 | if (matchPrefix(url, SLURL_SLURL_ALT_PREFIX)) return true; |
127 | if (matchPrefix(url, IZURL_IZ_HELP_PREFIX)) return true; | ||
128 | if (matchPrefix(url, IZURL_IZ_PREFIX)) return true; | ||
129 | if (matchPrefix(url, IZURL_INWORLDZ_PREFIX)) return true; | ||
130 | if (matchPrefix(url, IZURL_IZURL_PREFIX)) return true; | ||
122 | return false; | 131 | return false; |
123 | } | 132 | } |
124 | 133 | ||
@@ -128,7 +137,10 @@ bool LLURLDispatcherImpl::isSLURLCommand(const std::string& url) | |||
128 | if (matchPrefix(url, SLURL_SL_PREFIX + SLURL_APP_TOKEN) | 137 | if (matchPrefix(url, SLURL_SL_PREFIX + SLURL_APP_TOKEN) |
129 | || matchPrefix(url, SLURL_SECONDLIFE_PREFIX + "/" + SLURL_APP_TOKEN) | 138 | || matchPrefix(url, SLURL_SECONDLIFE_PREFIX + "/" + SLURL_APP_TOKEN) |
130 | || matchPrefix(url, SLURL_SLURL_PREFIX + SLURL_APP_TOKEN) | 139 | || matchPrefix(url, SLURL_SLURL_PREFIX + SLURL_APP_TOKEN) |
131 | || matchPrefix(url, SLURL_SLURL_ALT_PREFIX + SLURL_APP_TOKEN)) | 140 | || matchPrefix(url, SLURL_SLURL_ALT_PREFIX + SLURL_APP_TOKEN) |
141 | || matchPrefix(url, IZURL_IZ_PREFIX + SLURL_APP_TOKEN) | ||
142 | || matchPrefix(url, IZURL_INWORLDZ_PREFIX + "/" + SLURL_APP_TOKEN) | ||
143 | || matchPrefix(url, IZURL_IZURL_PREFIX + SLURL_APP_TOKEN)) | ||
132 | { | 144 | { |
133 | return true; | 145 | return true; |
134 | } | 146 | } |
@@ -371,6 +383,22 @@ std::string LLURLDispatcherImpl::stripProtocol(const std::string& url) | |||
371 | { | 383 | { |
372 | stripped.erase(0, SLURL_SLURL_ALT_PREFIX.length()); | 384 | stripped.erase(0, SLURL_SLURL_ALT_PREFIX.length()); |
373 | } | 385 | } |
386 | else if (matchPrefix(stripped, IZURL_IZ_HELP_PREFIX)) | ||
387 | { | ||
388 | stripped.erase(0, IZURL_IZ_HELP_PREFIX.length()); | ||
389 | } | ||
390 | else if (matchPrefix(stripped, IZURL_IZ_PREFIX)) | ||
391 | { | ||
392 | stripped.erase(0, IZURL_IZ_PREFIX.length()); | ||
393 | } | ||
394 | else if (matchPrefix(stripped, IZURL_INWORLDZ_PREFIX)) | ||
395 | { | ||
396 | stripped.erase(0, IZURL_INWORLDZ_PREFIX.length()); | ||
397 | } | ||
398 | else if (matchPrefix(stripped, IZURL_IZURL_PREFIX)) | ||
399 | { | ||
400 | stripped.erase(0, IZURL_IZURL_PREFIX.length()); | ||
401 | } | ||
374 | return stripped; | 402 | return stripped; |
375 | } | 403 | } |
376 | 404 | ||