diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 08b56d0996..fa91490036 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2638,7 +2638,10 @@ void LLTextBase::appendTextImpl(const std::string& new_text, const LLStyle::Para LLUrlMatch match; std::string text = new_text; while (LLUrlRegistry::instance().findUrl(text, match, - boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3), isContentTrusted() || mAlwaysShowIcons, force_slurl)) + // Pass nearby-chat flag for labeled-link masking + // boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3), isContentTrusted() || mAlwaysShowIcons, force_slurl)) + boost::bind(&LLTextBase::replaceUrl, this, _1, _2, _3), isContentTrusted() || mAlwaysShowIcons, force_slurl, mNearbyChatContent)) + // { start = match.getStart(); end = match.getEnd()+1; diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index debe440205..4947d52a5a 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -478,6 +478,10 @@ public: bool isContentTrusted() const { return mTrustedContent; } void setContentTrusted(bool trusted_content) { mTrustedContent = trusted_content; } + // Selects the nearby-chat labeled-link setting (FSDisableLabeledChatLinksNearbyChat) for this editor's content + void setNearbyChatContent(bool nearby_chat_content) { mNearbyChatContent = nearby_chat_content; } + // + // TODO: move into LLTextSegment? void createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url @@ -826,6 +830,7 @@ protected: bool mClip; // clip text to widget rect bool mClipPartial; // false if we show lines that are partially inside bounding rect bool mTrustedContent; // if false, does not allow to execute SURL links from this editor + bool mNearbyChatContent { false }; // if true, labeled-link masking uses the nearby chat setting bool mPlainText; // didn't use Image or Icon segments bool mAutoIndent; S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 816e9bb22f..176afb57f7 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -225,7 +225,10 @@ static bool stringHasJira(const std::string &text) text.find("WEB") != std::string::npos); } -bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb, bool is_content_trusted, bool skip_non_mentions) +// Option to disable bracket links needs is_nearby_chat here +// bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb, bool is_content_trusted, bool skip_non_mentions) +bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb, bool is_content_trusted, bool skip_non_mentions, bool is_nearby_chat) +// { // avoid costly regexes if there is clearly no URL in the text if (! (stringHasUrl(text) || stringHasJira(text))) @@ -253,7 +256,8 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL // Option to disable square-bracket links (intentionally ignores secondlife:// and hop://) static LLUICachedControl sDisableLabeledLinks("FSDisableLabeledChatLinks", false); - if (!is_content_trusted && (mUrlEntryHTTPLabel == *it) && sDisableLabeledLinks) + static LLUICachedControl sDisableLabeledLinksNearby("FSDisableLabeledChatLinksNearbyChat", false); + if (!is_content_trusted && (mUrlEntryHTTPLabel == *it) && (is_nearby_chat ? sDisableLabeledLinksNearby : sDisableLabeledLinks)) { continue; } diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h index 783b9e55cc..30003af1a1 100644 --- a/indra/llui/llurlregistry.h +++ b/indra/llui/llurlregistry.h @@ -75,7 +75,8 @@ public: /// your callback is invoked if the matched Url's label changes in the future bool findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb = &LLUrlRegistryNullCallback, - bool is_content_trusted = false, bool skip_non_mentions = false); + bool is_content_trusted = false, bool skip_non_mentions = false, + bool is_nearby_chat = false); // Option to disable bracket links needs is_nearby_chat here /// a slightly less efficient version of findUrl for wide strings bool findUrl(const LLWString &text, LLUrlMatch &match, diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1740bfab8f..f6b23882a0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -19658,7 +19658,18 @@ Change of this parameter will affect the layout of buttons in notification toast FSDisableLabeledChatLinks Comment - When true, do not treat wiki-style bracketed links ([https://host label]) as labeled URLs; mitigates misleading link text. + When true, do not treat wiki-style bracketed links ([https://host label]) as labeled URLs in IMs, group chat, ad-hoc conferences and group notices; mitigates misleading link text. + Persist + 1 + Type + Boolean + Value + 0 + + FSDisableLabeledChatLinksNearbyChat + + Comment + When true, do not treat wiki-style bracketed links ([https://host label]) as labeled URLs in nearby (local) chat and object text; mitigates misleading link text. Persist 1 Type diff --git a/indra/newview/fschathistory.cpp b/indra/newview/fschathistory.cpp index 698aa013bb..348930201c 100644 --- a/indra/newview/fschathistory.cpp +++ b/indra/newview/fschathistory.cpp @@ -1942,9 +1942,11 @@ void FSChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL bool is_trusted = isContentTrusted(); setContentTrusted(chat.mFromID.isNull() && is_p2p); // Set trusted content temporarily for system messages + setNearbyChatContent(is_local); // Use the nearby-chat labeled-link setting for local/object chat setPlainText((use_plain_text_chat_history && is_p2p) ? chat.mFromID.notNull() : use_plain_text_chat_history); appendText(message, prependNewLineState, body_message_params); // FIRE-8600: TAB out of chat history setContentTrusted(is_trusted); + setNearbyChatContent(false); // Use the nearby-chat labeled-link setting for local/object chat setPlainText(use_plain_text_chat_history); // Uncomment this if we never need to append to the end of a message. [FS:CR] //prependNewLineState = false; diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index acc31d7996..2cae9a4fdc 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -242,6 +242,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification) mMsgText = getChild("msg_text", false); mMsgText->setContentTrusted(false); + mMsgText->setNearbyChatContent(true); // Nearby chat toast follows the nearby-chat labeled-link setting mMsgText->setIsFriendCallback(LLAvatarActions::isFriend); mMsgText->setText(std::string("")); diff --git a/indra/newview/skins/default/xui/az/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/az/panel_preferences_firestorm.xml index a15a6dc814..0e608d2175 100644 --- a/indra/newview/skins/default/xui/az/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/az/panel_preferences_firestorm.xml @@ -40,7 +40,7 @@ - + Animasiya icazələrini ləğv edin: diff --git a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml index e213aae383..cd29ecd6cb 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml @@ -262,13 +262,23 @@ + tool_tip="When enabled, square-bracket links received in IMs, group chat, ad-hoc conferences and group notices from other residents are not collapsed into a single labeled link. The actual URL is shown and linked instead. Helps reduce phishing where the visible label hides a different destination. Nearby (local) chat is controlled by the separate option below. Built-in viewer text (notifications, preferences, etc.) is not affected."/> + - + Revocar permisos: diff --git a/indra/newview/skins/default/xui/it/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/it/panel_preferences_firestorm.xml index b23d394618..e14856e76c 100644 --- a/indra/newview/skins/default/xui/it/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/it/panel_preferences_firestorm.xml @@ -39,7 +39,7 @@ - + Rimuovi autorizzazioni: diff --git a/indra/newview/skins/default/xui/ja/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/ja/panel_preferences_firestorm.xml index c9e47df694..c59bfa74de 100644 --- a/indra/newview/skins/default/xui/ja/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/ja/panel_preferences_firestorm.xml @@ -47,7 +47,7 @@ - + オブジェクトのアニメーション権限取消: diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/pl/panel_preferences_firestorm.xml index 95ae769b66..f2253cda6b 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_firestorm.xml @@ -41,7 +41,8 @@ - + + Cofnij zezwolenia do animowania: diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/ru/panel_preferences_firestorm.xml index 906bd583c5..41598f2ce4 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_firestorm.xml @@ -41,7 +41,7 @@ - + Отменить разрешение анимирования: