diff options
author | Vadim Savchuk <vsavchuk@productengine.com> | 2010-07-12 17:22:29 +0300 |
---|---|---|
committer | Vadim Savchuk <vsavchuk@productengine.com> | 2010-07-12 17:22:29 +0300 |
commit | 15c944cd47359931d897f4734991d8849ee77ffe (patch) | |
tree | a41ffe57ba78f03a169a5245abfae6837b81665d | |
parent | dcf21a1287ed20806260aa38959b6fb585ee139a (diff) |
EXT-8209 FIXED Avoid escaping human-readable location when copying text from the location input.
Reason: LLSLURL constructor failed to determine invalid SLURLs (see EXT-8335).
It's late to try fixing it, so I introduced a workaround.
By the way, fixed a regression with SLURLs not being shown unescaped in the location input.
Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/726/
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/lllocationinputctrl.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llurllineeditorctrl.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index b8590d838e..46ebb54786 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -1052,7 +1052,7 @@ void LLLocationInputCtrl::changeLocationPresentation() //needs unescaped one LLSLURL slurl; LLAgentUI::buildSLURL(slurl, false); - mTextEntry->setText(slurl.getSLURLString()); + mTextEntry->setText(LLURI::unescape(slurl.getSLURLString())); mTextEntry->selectAll(); mMaturityButton->setVisible(FALSE); diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp index 8488527185..333f682e8f 100644 --- a/indra/newview/llurllineeditorctrl.cpp +++ b/indra/newview/llurllineeditorctrl.cpp @@ -89,9 +89,10 @@ void LLURLLineEditor::copyEscapedURLToClipboard() const std::string unescaped_text = wstring_to_utf8str(mText.getWString().substr(left_pos, length)); LLWString text_to_copy; - if (LLSLURL(unescaped_text).isValid()) + // *HACK: Because LLSLURL is currently broken we cannot use it to check if unescaped_text is a valid SLURL (see EXT-8335). + if (LLStringUtil::startsWith(unescaped_text, "http://")) // SLURL text_to_copy = utf8str_to_wstring(LLWeb::escapeURL(unescaped_text)); - else + else // human-readable location text_to_copy = utf8str_to_wstring(unescaped_text); gClipboard.copyFromString( text_to_copy ); |