Merge pull request #2397 from joe1chen/bug-fix-topic-search

Bug fix - Topic search broken due to encodeURIComponent being called too early
v1.18.x
Barış Soner Uşaklı 11 years ago
commit 36ac6f849f

@ -7,17 +7,18 @@ define('search', ['navigator'], function(nav) {
}; };
Search.query = function(term, callback) { Search.query = function(term, callback) {
// Detect if a tid was specified
var topicSearch = term.match(/in:topic-([\d]+)/);
if (!topicSearch) {
term = term.replace(/^[ ?#]*/, '');
try { try {
term = encodeURIComponent(term); term = encodeURIComponent(term);
} catch(e) { } catch(e) {
return app.alertError('[[error:invalid-search-term]]'); return app.alertError('[[error:invalid-search-term]]');
} }
// Detect if a tid was specified
var topicSearch = term.match(/in:topic-([\d]+)/);
if (!topicSearch) {
term = term.replace(/^[ ?#]*/, '');
ajaxify.go('search/' + term); ajaxify.go('search/' + term);
callback(); callback();
} else { } else {

Loading…
Cancel
Save