Lines 2661-2670
Link Here
|
2661 |
NS_IMETHODIMP |
2661 |
NS_IMETHODIMP |
2662 |
InternetSearchDataSource::GetInternetSearchURL(const char *searchEngineURI, |
2662 |
InternetSearchDataSource::GetInternetSearchURL(const char *searchEngineURI, |
2663 |
const PRUnichar *searchStr, PRInt16 direction, PRUint16 pageNumber, |
2663 |
const PRUnichar *searchStr, PRInt16 direction, PRUint16 pageNumber, |
2664 |
PRUint16 *whichButtons, char **resultURL) |
2664 |
PRUint16 *whichButtons, char **postData, char **resultURL) |
2665 |
{ |
2665 |
{ |
2666 |
if (!resultURL) return(NS_ERROR_NULL_POINTER); |
2666 |
if (!resultURL) return(NS_ERROR_NULL_POINTER); |
2667 |
*resultURL = nsnull; |
2667 |
*resultURL = nsnull; |
|
|
2668 |
if (postData) *postData = nsnull; |
2668 |
|
2669 |
|
2669 |
// if we haven't already, load in the engines |
2670 |
// if we haven't already, load in the engines |
2670 |
if (!gEngineListBuilt) |
2671 |
if (!gEngineListBuilt) |
Lines 2760-2769
Link Here
|
2760 |
return(rv); |
2761 |
return(rv); |
2761 |
if (input.IsEmpty()) return(NS_ERROR_UNEXPECTED); |
2762 |
if (input.IsEmpty()) return(NS_ERROR_UNEXPECTED); |
2762 |
|
2763 |
|
2763 |
// we can only handle HTTP GET |
2764 |
// we can only handle HTTP GET & POST |
2764 |
if (!method.LowerCaseEqualsLiteral("get")) return(NS_ERROR_UNEXPECTED); |
2765 |
if (method.LowerCaseEqualsLiteral("get")) |
2765 |
// HTTP Get method support |
2766 |
{ |
2766 |
action += input; |
2767 |
// HTTP Get method support |
|
|
2768 |
action += input; |
2769 |
} else if (method.LowerCaseEqualsLiteral("post") && postData) |
2770 |
{ |
2771 |
// HTTP Post method support |
2772 |
// skip leading '?' in url-encoded variables for post data: |
2773 |
*postData = ToNewCString( nsAutoString(input.get() + 1) ); |
2774 |
} else return(NS_ERROR_UNEXPECTED); |
2767 |
|
2775 |
|
2768 |
// return a copy of the resulting search URL |
2776 |
// return a copy of the resulting search URL |
2769 |
*resultURL = ToNewCString(action); |
2777 |
*resultURL = ToNewCString(action); |