зеркало из https://github.com/mozilla/pjs.git
bug 55052 (r=nhotta, sr= alecf) search text field changes what user types, and bug 28137 (r=sgehani, sr=alecf, URL search bar should reset category popup
This commit is contained in:
Родитель
05cacfaa8c
Коммит
9be6b22d7e
|
@ -2595,6 +2595,11 @@ InternetSearchDataSource::FindInternetSearchResults(const char *url, PRBool *sea
|
|||
{
|
||||
nsCAutoString escapedSearchText;
|
||||
escapedSearchText.AssignWithConversion(searchText);
|
||||
|
||||
// encoding +'s so as to preserve distinction between + and %2B
|
||||
escapedSearchText.ReplaceSubstring("%25", "%2B25");
|
||||
escapedSearchText.ReplaceSubstring("+", "%25");
|
||||
|
||||
nsCAutoString aCharset;
|
||||
aCharset.AssignWithConversion(mQueryEncodingStr);
|
||||
PRUnichar *uni = nsnull;
|
||||
|
@ -2603,7 +2608,14 @@ InternetSearchDataSource::FindInternetSearchResults(const char *url, PRBool *sea
|
|||
char *convertedSearchText = nsnull;
|
||||
if (NS_SUCCEEDED(rv = textToSubURI->ConvertAndEscape("UTF-8", uni, &convertedSearchText)))
|
||||
{
|
||||
searchText.AssignWithConversion(convertedSearchText);
|
||||
|
||||
// decoding +'s thereby preserving distinction between + and %2B
|
||||
nsCAutoString unescapedSearchText(convertedSearchText);
|
||||
unescapedSearchText.ReplaceSubstring("%25", "+");
|
||||
unescapedSearchText.ReplaceSubstring("%2B25", "%25");
|
||||
|
||||
searchText.AssignWithConversion(unescapedSearchText);
|
||||
|
||||
Recycle(convertedSearchText);
|
||||
}
|
||||
Recycle(uni);
|
||||
|
|
Загрузка…
Ссылка в новой задаче