mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Fix for bug 9255. We were not trimming leading and trailing whitespace from the url typed in the location bar. Now we do.
This commit is contained in:
parent
a4bb19abc2
commit
4b73654f45
@ -1953,15 +1953,20 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec,
|
||||
{
|
||||
nsresult rv;
|
||||
nsAutoString urlSpec;
|
||||
convertFileToURL(nsString(aURLSpec), urlSpec);
|
||||
nsString urlStr = aURLSpec;
|
||||
urlStr.Trim(" ", PR_TRUE, PR_TRUE);
|
||||
convertFileToURL(urlStr, urlSpec);
|
||||
|
||||
//#ifdef NECKO
|
||||
// nsCOMPtr<nsIURI> url;
|
||||
// rv = NS_NewURI(getter_AddRefs(url), urlSpec);
|
||||
// if (NS_FAILED(rv)) return rv;
|
||||
//#else
|
||||
|
||||
PRInt32 colon, fSlash;
|
||||
PRUnichar port;
|
||||
fSlash=urlSpec.Find('/');
|
||||
|
||||
|
||||
// if no scheme (protocol) is found, assume http.
|
||||
if ( ((colon=urlSpec.Find(':')) == -1) // no colon at all
|
||||
|
@ -1953,15 +1953,20 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec,
|
||||
{
|
||||
nsresult rv;
|
||||
nsAutoString urlSpec;
|
||||
convertFileToURL(nsString(aURLSpec), urlSpec);
|
||||
nsString urlStr = aURLSpec;
|
||||
urlStr.Trim(" ", PR_TRUE, PR_TRUE);
|
||||
convertFileToURL(urlStr, urlSpec);
|
||||
|
||||
//#ifdef NECKO
|
||||
// nsCOMPtr<nsIURI> url;
|
||||
// rv = NS_NewURI(getter_AddRefs(url), urlSpec);
|
||||
// if (NS_FAILED(rv)) return rv;
|
||||
//#else
|
||||
|
||||
PRInt32 colon, fSlash;
|
||||
PRUnichar port;
|
||||
fSlash=urlSpec.Find('/');
|
||||
|
||||
|
||||
// if no scheme (protocol) is found, assume http.
|
||||
if ( ((colon=urlSpec.Find(':')) == -1) // no colon at all
|
||||
|
Loading…
Reference in New Issue
Block a user