Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 138577
Collapse All | Expand All

(-)mozilla/browser/base/content/browser.js (-4 / +5 lines)
Lines 1759-1778 Link Here
1759
  setTimeout(SearchLoadURL, 0, aURL, aInNewTab);
1759
  setTimeout(SearchLoadURL, 0, aURL, aInNewTab);
1760
}
1760
}
1761
1761
1762
function SearchLoadURL(aURL, aInNewTab)
1762
function SearchLoadURL(aURL, aInNewTab, postData)
1763
{
1763
{
1764
  if (!aURL)
1764
  if (!aURL)
1765
    return;
1765
    return;
1766
1766
1767
  if (gBrowser.localName == "tabbrowser" && aInNewTab) {
1767
  if (gBrowser.localName == "tabbrowser" && aInNewTab) {
1768
    content.focus();
1768
    content.focus();
1769
    var t = gBrowser.addTab(aURL, null); // open link in new tab
1769
    var t = gBrowser.addTab(aURL, null, null, postData); // open link in new tab
1770
    gBrowser.selectedTab = t;
1770
    gBrowser.selectedTab = t;
1771
    if (gURLBar)
1771
    if (gURLBar)
1772
      gURLBar.value = aURL;
1772
      gURLBar.value = aURL;
1773
  }
1773
  }
1774
  else
1774
  else {
1775
    loadURI(aURL, null, null);
1775
    loadURI(aURL, null, postData);
1776
  }
1776
  content.focus();
1777
  content.focus();
1777
}
1778
}
(-)mozilla/browser/base/content/search.xml (-2 / +10 lines)
Lines 300-309 Link Here
300
300
301
          var ISEARCHSVC = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"]
301
          var ISEARCHSVC = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"]
302
                                     .getService(Components.interfaces.nsIInternetSearchService);
302
                                     .getService(Components.interfaces.nsIInternetSearchService);
303
          var postData={value:""};
303
          //XXX Bug 269994: Add in dummy search text "ABC" if the field is empty to ensure a result
304
          //XXX Bug 269994: Add in dummy search text "ABC" if the field is empty to ensure a result
304
          var searchURL = ISEARCHSVC.GetInternetSearchURL(this.currentEngine,
305
          var searchURL = ISEARCHSVC.GetInternetSearchURL(this.currentEngine,
305
                                       this.value? encodeURIComponent(this.value):"ABC", 
306
                                       this.value? encodeURIComponent(this.value):"ABC", 
306
                                       0, 0, {value:0});
307
                                       0, 0, {value:0}, postData);
308
          
309
          if (postData.value && postData.value.length>0) {
310
            postData = getPostDataStream(postData.value, " ", " ", "application/x-www-form-urlencoded");
311
          }
312
          else {
313
            postData = null;
314
          }
307
315
308
          // if the search box is empty, let's load the host
316
          // if the search box is empty, let's load the host
309
          if (!this.value) {
317
          if (!this.value) {
Lines 316-322 Link Here
316
            } catch (ex) {}
324
            } catch (ex) {}
317
          }
325
          }
318
          var evt = aEvent || this.mEnterEvent;
326
          var evt = aEvent || this.mEnterEvent;
319
          SearchLoadURL(searchURL, (evt && evt.altKey));
327
          SearchLoadURL(searchURL, (evt && evt.altKey), postData);
320
        ]]></body>
328
        ]]></body>
321
      </method>
329
      </method>
(-)mozilla/xpfe/components/search/public/nsISearchService.idl (-1 / +2 lines)
Lines 59-65 Link Here
59
  const unsigned short kHaveNext = 1;
59
  const unsigned short kHaveNext = 1;
60
  const unsigned short kHavePrev = 2;
60
  const unsigned short kHavePrev = 2;
61
61
62
  string      GetInternetSearchURL(in string searchEngineURI, in wstring searchStr, in short direction, in unsigned short pageNumber, out unsigned short whichButtons);
62
//  string      GetInternetSearchURL(in string searchEngineURI, in wstring searchStr, in short direction, in unsigned short pageNumber, out unsigned short whichButtons);
63
  string      GetInternetSearchURL(in string searchEngineURI, in wstring searchStr, in short direction, in unsigned short pageNumber, out unsigned short whichButtons, out string postData);
63
  void      RememberLastSearchText(in wstring escapedSearchStr);
64
  void      RememberLastSearchText(in wstring escapedSearchStr);
64
  boolean      FindInternetSearchResults(in string url);
65
  boolean      FindInternetSearchResults(in string url);
65
  void      Stop();
66
  void      Stop();
(-)mozilla/xpfe/components/search/src/nsInternetSearchService.cpp (-5 / +13 lines)
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);

Return to bug 138577