Revert earlier back-out for MAINT-535 ... it's back in

master
simon 2014-01-10 13:15:19 -08:00
parent f291995dac
commit cfadbe631f
10 changed files with 21 additions and 54 deletions

View File

@ -1855,9 +1855,7 @@ void LLScrollListCtrl::showNameDetails(std::string id, bool is_group)
// open the resident's details or the group details
std::string sltype = is_group ? "group" : "agent";
std::string slurl = "secondlife:///app/" + sltype + "/" + id + "/about";
LLUrlAction::clickAction(slurl);
// MAINT-535 reversion test
//LLUrlAction::clickAction(slurl, true);
LLUrlAction::clickAction(slurl, true);
}
void LLScrollListCtrl::copyNameToClipboard(std::string id, bool is_group)

View File

@ -167,8 +167,7 @@ LLTextBase::Params::Params()
max_text_length("max_length", 255),
font_shadow("font_shadow"),
wrap("wrap"),
// MAINT-535 reversion test
// trusted_content("trusted_content", true),
trusted_content("trusted_content", true),
use_ellipses("use_ellipses", false),
parse_urls("parse_urls", false),
parse_highlights("parse_highlights", false)
@ -213,8 +212,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p)
mLineSpacingPixels(p.line_spacing.pixels),
mClip(p.clip),
mClipPartial(p.clip_partial && !p.allow_scroll),
// MAINT-535 reversion test
// mTrustedContent(p.trusted_content),
mTrustedContent(p.trusted_content),
mTrackEnd( p.track_end ),
mScrollIndex(-1),
mSelectionStart( 0 ),
@ -3168,9 +3166,7 @@ BOOL LLNormalTextSegment::handleMouseUp(S32 x, S32 y, MASK mask)
// Only process the click if it's actually in this segment, not to the right of the end-of-line.
if(mEditor.getSegmentAtLocalPos(x, y, false) == this)
{
LLUrlAction::clickAction(getStyle()->getLinkHREF());
// MAINT-535 reversion test
// LLUrlAction::clickAction(getStyle()->getLinkHREF(), mEditor.isContentTrusted());
LLUrlAction::clickAction(getStyle()->getLinkHREF(), mEditor.isContentTrusted());
return TRUE;
}
}

View File

@ -291,11 +291,9 @@ public:
parse_urls,
parse_highlights,
clip,
clip_partial;
// MAINT-535 reversion test
// clip_partial,
// trusted_content;
clip_partial,
trusted_content;
Optional<S32> v_pad,
h_pad;
@ -364,8 +362,7 @@ public:
bool getWordWrap() { return mWordWrap; }
bool getUseEllipses() { return mUseEllipses; }
bool truncate(); // returns true of truncation occurred
// MAINT-535 reversion test
//bool isContentTrusted() {return mTrustedContent;}
bool isContentTrusted() {return mTrustedContent;}
// TODO: move into LLTextSegment?
void createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url
@ -639,8 +636,7 @@ protected:
bool mBGVisible; // render background?
bool mClip; // clip text to widget rect
bool mClipPartial; // false if we show lines that are partially inside bounding rect
// MAINT-535 reversion test
//bool mTrustedContent; // if false, does not allow to execute SURL links from this editor
bool mTrustedContent; // if false, does not allow to execute SURL links from this editor
bool mPlainText; // didn't use Image or Icon segments
bool mAutoIndent;
S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes

View File

@ -87,20 +87,14 @@ void LLUrlAction::executeSLURL(std::string url)
{
if (sExecuteSLURLCallback)
{
sExecuteSLURLCallback(url);
// MAINT-535 reversion test
//sExecuteSLURLCallback(url ,true);
sExecuteSLURLCallback(url ,true);
}
}
// MAINT-535 reversion test
//void LLUrlAction::clickAction(std::string url, bool trusted_content)
void LLUrlAction::clickAction(std::string url)
void LLUrlAction::clickAction(std::string url, bool trusted_content)
{
// Try to handle as SLURL first, then http Url
// MAINT-535 reversion test
// if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url, trusted_content) )
if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url) )
if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url, trusted_content) )
{
if (sOpenURLCallback)
{

View File

@ -66,9 +66,7 @@ public:
static void showLocationOnMap(std::string url);
/// perform the appropriate action for left-clicking on a Url
static void clickAction(std::string url);
// MAINT-535 reversion test
//static void clickAction(std::string url, bool trusted_content);
static void clickAction(std::string url, bool trusted_content);
/// copy the label for a Url to the clipboard
static void copyLabelToClipboard(std::string url);
@ -88,9 +86,7 @@ public:
/// specify the callbacks to enable this class's functionality
typedef boost::function<void (const std::string&)> url_callback_t;
typedef boost::function<bool(const std::string& url)> execute_url_callback_t;
// MAINT-535 reversion test
//typedef boost::function<bool(const std::string& url, bool trusted_content)> execute_url_callback_t;
typedef boost::function<bool(const std::string& url, bool trusted_content)> execute_url_callback_t;
static void setOpenURLCallback(url_callback_t cb);
static void setOpenURLInternalCallback(url_callback_t cb);

View File

@ -1067,10 +1067,8 @@ LLUrlEntrySLLabel::LLUrlEntrySLLabel()
std::string LLUrlEntrySLLabel::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
// MAINT-535 reversion test
// std::string label = getLabelFromWikiLink(url);
// return (!LLUrlRegistry::instance().hasUrl(label)) ? label : getUrl(url);
return getLabelFromWikiLink(url);
std::string label = getLabelFromWikiLink(url);
return (!LLUrlRegistry::instance().hasUrl(label)) ? label : getUrl(url);
}
std::string LLUrlEntrySLLabel::getUrl(const std::string &string) const

View File

@ -731,8 +731,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p)
editor_params.follows.flags = FOLLOWS_ALL;
editor_params.enabled = false; // read only
editor_params.show_context_menu = "true";
// MAINT-535 reversion test
//editor_params.trusted_content = false;
editor_params.trusted_content = false;
mEditor = LLUICtrlFactory::create<LLTextEditor>(editor_params, this);
mEditor->setIsFriendCallback(LLAvatarActions::isFriend);
}

View File

@ -307,9 +307,7 @@ bool LLURLDispatcher::dispatchRightClick(const std::string& slurl)
}
// static
// MAINT-535 reversion test
// bool LLURLDispatcher::dispatchFromTextEditor(const std::string& slurl, bool trusted_content)
bool LLURLDispatcher::dispatchFromTextEditor(const std::string& slurl)
bool LLURLDispatcher::dispatchFromTextEditor(const std::string& slurl, bool trusted_content)
{
// *NOTE: Text editors are considered sources of trusted URLs
// in order to make avatar profile links in chat history work.
@ -317,13 +315,9 @@ bool LLURLDispatcher::dispatchFromTextEditor(const std::string& slurl)
// receiving resident will see it and must affirmatively
// click on it.
// *TODO: Make this trust model more refined. JC
const bool trusted_browser = true;
LLMediaCtrl* web = NULL;
return LLURLDispatcherImpl::dispatch(LLSLURL(slurl), "clicked", web, trusted_browser);
// MAINT-535 reversion test
//return LLURLDispatcherImpl::dispatch(LLSLURL(slurl), "clicked", web, trusted_content);
return LLURLDispatcherImpl::dispatch(LLSLURL(slurl), "clicked", web, trusted_content);
}

View File

@ -53,9 +53,7 @@ public:
static bool dispatchRightClick(const std::string& slurl);
static bool dispatchFromTextEditor(const std::string& slurl);
// MAINT-535 reversion test
//static bool dispatchFromTextEditor(const std::string& slurl, bool trusted_content);
static bool dispatchFromTextEditor(const std::string& slurl, bool trusted_content);
};
#endif

View File

@ -71,7 +71,5 @@ void LLURLDispatcherListener::dispatchRightClick(const LLSD& params) const
void LLURLDispatcherListener::dispatchFromTextEditor(const LLSD& params) const
{
LLURLDispatcher::dispatchFromTextEditor(params["url"]);
// MAINT-535 reversion test
// LLURLDispatcher::dispatchFromTextEditor(params["url"], false);
LLURLDispatcher::dispatchFromTextEditor(params["url"], false);
}