summaryrefslogtreecommitdiff
path: root/indra/llcommon/lluri.cpp
diff options
context:
space:
mode:
authormberezhnoy <mberezhnoy@productengine.com>2013-06-07 19:34:34 +0300
committermberezhnoy <mberezhnoy@productengine.com>2013-06-07 19:34:34 +0300
commit15b6a395d00d55c50e98c86498669bd06782cb15 (patch)
tree0a64d37e2b21c5e084d7855be7128c28f458ac89 /indra/llcommon/lluri.cpp
parent57b21335ba232d4023ec2cda81153d02bc190f6b (diff)
parent0bcb1db3ea8056e96b6cb087758e6ee57bc122a3 (diff)
merge
Diffstat (limited to 'indra/llcommon/lluri.cpp')
-rwxr-xr-xindra/llcommon/lluri.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp
index 21456a599b..37f5b3d6a3 100755
--- a/indra/llcommon/lluri.cpp
+++ b/indra/llcommon/lluri.cpp
@@ -129,11 +129,30 @@ std::string LLURI::unescape(const std::string& str)
{
++it;
if(it == end) break;
- U8 c = hex_as_nybble(*it++);
- c = c << 4;
- if (it == end) break;
- c |= hex_as_nybble(*it);
- ostr.put((char)c);
+
+ if(is_char_hex(*it))
+ {
+ U8 c = hex_as_nybble(*it++);
+
+ c = c << 4;
+ if (it == end) break;
+
+ if(is_char_hex(*it))
+ {
+ c |= hex_as_nybble(*it);
+ ostr.put((char)c);
+ }
+ else
+ {
+ ostr.put((char)c);
+ ostr.put(*it);
+ }
+ }
+ else
+ {
+ ostr.put('%');
+ ostr.put(*it);
+ }
}
else
{