From 49292bf61e6db3c02afd6696db43c3f5c627c6c1 Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 6 Dec 2014 20:54:03 -0800 Subject: [PATCH] fix multi-byte character hashtag --- js/interface_common.js | 2 +- js/twister_actions.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index 4f47ccf..cddb7e6 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -174,7 +174,7 @@ function openHashtagModal(e) function openHashtagModalFromSearch(hashtag) { - window.location.hash = '#hashtag?hashtag=' + hashtag; + window.location.hash = '#hashtag?hashtag=' + encodeURIComponent(hashtag); } function openHashtagModalFromSearchHandler(hashtag) diff --git a/js/twister_actions.js b/js/twister_actions.js index 3be5e85..fb04b79 100644 --- a/js/twister_actions.js +++ b/js/twister_actions.js @@ -307,7 +307,7 @@ function requestHashtag(postboard,hashtag,resource, timeoutArgs) { } function processHashtag(postboard, hashtag, data) { - if( data && window.location.hash.indexOf(hashtag) != -1 ) { + if( data && window.location.hash.indexOf(encodeURIComponent(hashtag)) != -1 ) { for( var i = data.length-1; i >= 0; i-- ) { var userpost = data[i]["userpost"]; var key = userpost["n"] + ";" + userpost["time"];