diff options
author | callum <none@none> | 2009-10-15 14:49:27 -0700 |
---|---|---|
committer | callum <none@none> | 2009-10-15 14:49:27 -0700 |
commit | 12628429d8553cf242a38f820187552b6fe93628 (patch) | |
tree | b7f4793d696ec29d1d54aa22da694e7dccf45d02 /indra/newview/llpanelmediasettingssecurity.cpp | |
parent | 3831ca912eb8b78ccdcfac7d37c015ca45351c83 (diff) |
Fixed defect for URLs that already have a scheme
See http://10.1.19.90:8080/go?page=ReviewDisplay&reviewid=18
Diffstat (limited to 'indra/newview/llpanelmediasettingssecurity.cpp')
-rw-r--r-- | indra/newview/llpanelmediasettingssecurity.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp index bdbc64e4b0..f5607aa287 100644 --- a/indra/newview/llpanelmediasettingssecurity.cpp +++ b/indra/newview/llpanelmediasettingssecurity.cpp @@ -236,16 +236,20 @@ void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in ) // white list list box widget and build a list to test against. Can also
const std::string LLPanelMediaSettingsSecurity::makeValidUrl( const std::string& src_url )
{
- // make sure the fragment has a scheme
- const std::string default_scheme( "http://" );
- if ( src_url.find( default_scheme ) == std::string::npos )
- {
+ // use LLURI to determine if we have a valid scheme
+ LLURI candidate_url( src_url ); + if ( candidate_url.scheme().empty() ) + { + // build a URL comprised of default scheme and the original fragment
+ const std::string default_scheme( "http://" );
return default_scheme + src_url;
- };
-
- // TODO: probably other checks and defaults we can do here..
+ }; + + // we *could* test the "default scheme" + "original fragment" URL again + // using LLURI to see if it's valid but I think the outcome is the same + // in either case - our only option is to return the original URL - // this is now a "valid" URL
+ // we *think* the original url passed in was valid
return src_url;
}
|