зеркало из https://github.com/mozilla/pjs.git
moved http:// assumption code into nsWebShell.cpp from nsBrowserWindow.cpp
This commit is contained in:
Родитель
7d6d0c2535
Коммит
552110779f
|
@ -797,9 +797,23 @@ nsWebShell::LoadURL(const nsString& aURLSpec,
|
|||
nsIPostData* aPostData)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Give web-shell-container right of refusal
|
||||
PRInt32 colon, fSlash;
|
||||
PRUnichar port;
|
||||
nsAutoString urlSpec(aURLSpec);
|
||||
|
||||
fSlash=urlSpec.Find('/');
|
||||
|
||||
// if no scheme (protocol) is found, assume http.
|
||||
if ( ((colon=urlSpec.Find(':')) == -1) // no colon at all
|
||||
|| ( (fSlash > -1) && (colon > fSlash) ) // the only colon comes after the first slash
|
||||
|| ( (colon < urlSpec.Length()-1) // the first char after the first colon is a digit (i.e. a port)
|
||||
&& ((port=urlSpec.CharAt(colon+1)) < '9')
|
||||
&& (port > '0') )
|
||||
) {
|
||||
nsString httpDef("http://");
|
||||
urlSpec.Insert(httpDef, 0, 7);
|
||||
}
|
||||
// Give web-shell-container right of refusal
|
||||
if (nsnull != mContainer) {
|
||||
rv = mContainer->WillLoadURL(this, urlSpec);
|
||||
if (NS_OK != rv) {
|
||||
|
|
|
@ -797,9 +797,23 @@ nsWebShell::LoadURL(const nsString& aURLSpec,
|
|||
nsIPostData* aPostData)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Give web-shell-container right of refusal
|
||||
PRInt32 colon, fSlash;
|
||||
PRUnichar port;
|
||||
nsAutoString urlSpec(aURLSpec);
|
||||
|
||||
fSlash=urlSpec.Find('/');
|
||||
|
||||
// if no scheme (protocol) is found, assume http.
|
||||
if ( ((colon=urlSpec.Find(':')) == -1) // no colon at all
|
||||
|| ( (fSlash > -1) && (colon > fSlash) ) // the only colon comes after the first slash
|
||||
|| ( (colon < urlSpec.Length()-1) // the first char after the first colon is a digit (i.e. a port)
|
||||
&& ((port=urlSpec.CharAt(colon+1)) < '9')
|
||||
&& (port > '0') )
|
||||
) {
|
||||
nsString httpDef("http://");
|
||||
urlSpec.Insert(httpDef, 0, 7);
|
||||
}
|
||||
// Give web-shell-container right of refusal
|
||||
if (nsnull != mContainer) {
|
||||
rv = mContainer->WillLoadURL(this, urlSpec);
|
||||
if (NS_OK != rv) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче