diff --git a/extensions/wallet/signonviewer/SignonViewer.js b/extensions/wallet/signonviewer/SignonViewer.js index f755729492ca..5e7e9be6356d 100644 --- a/extensions/wallet/signonviewer/SignonViewer.js +++ b/extensions/wallet/signonviewer/SignonViewer.js @@ -229,8 +229,7 @@ function LoadNopreview() var currSignon = TrimString(nopreviewList[i]); // TEMP HACK until morse fixes signon viewer functions currSignon = RemoveHTMLFormatting(currSignon); - var form = currSignon.substring(currSignon.lastIndexOf(":")+1,currSignon.length); - AddItem("nopreviewlist",[form],"nopreview_",i-1); + AddItem("nopreviewlist",[currSignon],"nopreview_",i-1); } if (deleted_nopreviews_count >= nopreviewList.length) { document.getElementById("removeAllNopreviews").setAttribute("disabled","true"); @@ -274,8 +273,7 @@ function LoadNocapture() var currSignon = TrimString(nocaptureList[i]); // TEMP HACK until morse fixes signon viewer functions currSignon = RemoveHTMLFormatting(currSignon); - var form = currSignon.substring(currSignon.lastIndexOf(":")+1,currSignon.length); - AddItem("nocapturelist",[form],"nocapture_",i-1); + AddItem("nocapturelist",[currSignon],"nocapture_",i-1); } if (deleted_nocaptures_count >= nocaptureList.length) { document.getElementById("removeAllNocaptures").setAttribute("disabled","true"); diff --git a/extensions/wallet/src/wallet.cpp b/extensions/wallet/src/wallet.cpp index 316cfc74be56..2b43f00c7d09 100644 --- a/extensions/wallet/src/wallet.cpp +++ b/extensions/wallet/src/wallet.cpp @@ -3428,6 +3428,8 @@ WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindow* window) { /* get url name as ascii string */ char *URLName = nsnull; + char *strippedURLName = nsnull; + nsAutoString strippedURLNameAutoString; nsCOMPtr docURL; nsCOMPtr doc; currentForm->GetDocument(*getter_AddRefs(doc)); @@ -3439,11 +3441,14 @@ WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindow* window) { return; } (void)docURL->GetSpec(&URLName); + wallet_GetHostFile(docURL, strippedURLNameAutoString); + strippedURLName = strippedURLNameAutoString.ToNewCString(); /* get to the form elements */ nsCOMPtr htmldoc(do_QueryInterface(doc)); if (htmldoc == nsnull) { nsCRT::free(URLName); + nsCRT::free(strippedURLName); return; } @@ -3451,6 +3456,7 @@ WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindow* window) { nsresult rv = htmldoc->GetForms(getter_AddRefs(forms)); if (NS_FAILED(rv) || (forms == nsnull)) { nsCRT::free(URLName); + nsCRT::free(strippedURLName); return; } @@ -3593,7 +3599,7 @@ WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindow* window) { #else /* save form if it meets all necessary conditions */ if (wallet_GetFormsCapturingPref() && - (OKToPrompt) && wallet_OKToCapture(URLName, window)) { + (OKToPrompt) && wallet_OKToCapture(strippedURLName, window)) { /* give caveat if this is the first time data is being captured */ Wallet_GiveCaveat(window, nsnull); @@ -3643,6 +3649,7 @@ WLLT_OnSubmit(nsIContent* currentForm, nsIDOMWindow* window) { } } nsCRT::free(URLName); + nsCRT::free(strippedURLName); } PUBLIC void