Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 90522 Details for
Bug 138577
mozilla-firefox: HTTP POST-method support for search engine plugins
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
mozilla-firefox-1.5.0.4_post-method-search.patch
mozilla-firefox-1.5.0.4_post-method-search.patch (text/plain), 4.55 KB, created by
Thomas Frenzel
on 2006-06-30 05:43:13 UTC
(
hide
)
Description:
mozilla-firefox-1.5.0.4_post-method-search.patch
Filename:
MIME Type:
Creator:
Thomas Frenzel
Created:
2006-06-30 05:43:13 UTC
Size:
4.55 KB
patch
obsolete
>--- mozilla/browser/base/content/browser.js 2006-05-03 02:45:14.000000000 +0200 >+++ mozilla/browser/base/content/browser.js 2006-06-30 00:59:24.000000000 +0200 >@@ -1759,20 +1759,21 @@ > setTimeout(SearchLoadURL, 0, aURL, aInNewTab); > } > >-function SearchLoadURL(aURL, aInNewTab) >+function SearchLoadURL(aURL, aInNewTab, postData) > { > if (!aURL) > return; > > if (gBrowser.localName == "tabbrowser" && aInNewTab) { > content.focus(); >- var t = gBrowser.addTab(aURL, null); // open link in new tab >+ var t = gBrowser.addTab(aURL, null, null, postData); // open link in new tab > gBrowser.selectedTab = t; > if (gURLBar) > gURLBar.value = aURL; > } >- else >- loadURI(aURL, null, null); >+ else { >+ loadURI(aURL, null, postData); >+ } > content.focus(); > } > >--- mozilla/browser/base/content/search.xml 2006-06-30 02:01:32.000000000 +0200 >+++ mozilla/browser/base/content/search.xml 2006-06-30 01:04:26.000000000 +0200 >@@ -300,10 +300,18 @@ > > var ISEARCHSVC = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"] > .getService(Components.interfaces.nsIInternetSearchService); >+ var postData={value:""}; > //XXX Bug 269994: Add in dummy search text "ABC" if the field is empty to ensure a result > var searchURL = ISEARCHSVC.GetInternetSearchURL(this.currentEngine, > this.value? encodeURIComponent(this.value):"ABC", >- 0, 0, {value:0}); >+ 0, 0, {value:0}, postData); >+ >+ if (postData.value && postData.value.length>0) { >+ postData = getPostDataStream(postData.value, " ", " ", "application/x-www-form-urlencoded"); >+ } >+ else { >+ postData = null; >+ } > > // if the search box is empty, let's load the host > if (!this.value) { >@@ -316,7 +324,7 @@ > } catch (ex) {} > } > var evt = aEvent || this.mEnterEvent; >- SearchLoadURL(searchURL, (evt && evt.altKey)); >+ SearchLoadURL(searchURL, (evt && evt.altKey), postData); > ]]></body> > </method> > >--- mozilla/xpfe/components/search/public/nsISearchService.idl 2005-04-16 06:37:39.000000000 +0200 >+++ mozilla/xpfe/components/search/public/nsISearchService.idl 2006-06-29 10:06:53.000000000 +0200 >@@ -59,7 +59,8 @@ > const unsigned short kHaveNext = 1; > const unsigned short kHavePrev = 2; > >- string GetInternetSearchURL(in string searchEngineURI, in wstring searchStr, in short direction, in unsigned short pageNumber, out unsigned short whichButtons); >+// string GetInternetSearchURL(in string searchEngineURI, in wstring searchStr, in short direction, in unsigned short pageNumber, out unsigned short whichButtons); >+ string GetInternetSearchURL(in string searchEngineURI, in wstring searchStr, in short direction, in unsigned short pageNumber, out unsigned short whichButtons, out string postData); > void RememberLastSearchText(in wstring escapedSearchStr); > boolean FindInternetSearchResults(in string url); > void Stop(); > >--- mozilla/xpfe/components/search/src/nsInternetSearchService.cpp 2006-02-23 05:30:19.000000000 +0100 >+++ mozilla/xpfe/components/search/src/nsInternetSearchService.cpp 2006-06-29 10:31:52.000000000 +0200 >@@ -2661,10 +2661,11 @@ > NS_IMETHODIMP > InternetSearchDataSource::GetInternetSearchURL(const char *searchEngineURI, > const PRUnichar *searchStr, PRInt16 direction, PRUint16 pageNumber, >- PRUint16 *whichButtons, char **resultURL) >+ PRUint16 *whichButtons, char **postData, char **resultURL) > { > if (!resultURL) return(NS_ERROR_NULL_POINTER); > *resultURL = nsnull; >+ if (postData) *postData = nsnull; > > // if we haven't already, load in the engines > if (!gEngineListBuilt) >@@ -2760,10 +2761,17 @@ > return(rv); > if (input.IsEmpty()) return(NS_ERROR_UNEXPECTED); > >- // we can only handle HTTP GET >- if (!method.LowerCaseEqualsLiteral("get")) return(NS_ERROR_UNEXPECTED); >- // HTTP Get method support >- action += input; >+ // we can only handle HTTP GET & POST >+ if (method.LowerCaseEqualsLiteral("get")) >+ { >+ // HTTP Get method support >+ action += input; >+ } else if (method.LowerCaseEqualsLiteral("post") && postData) >+ { >+ // HTTP Post method support >+ // skip leading '?' in url-encoded variables for post data: >+ *postData = ToNewCString( nsAutoString(input.get() + 1) ); >+ } else return(NS_ERROR_UNEXPECTED); > > // return a copy of the resulting search URL > *resultURL = ToNewCString(action);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 138577
: 90522 |
90523
|
90525