Skip to content

Commit

Permalink
bug fix: use EncodedPath instead of Query(Un)Escape
Browse files Browse the repository at this point in the history
  • Loading branch information
epoll committed Jan 4, 2012
1 parent 88631b6 commit 95c9e1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/twitter2mongo.go
Expand Up @@ -124,7 +124,7 @@ func Crawl(pool *mgo.Session, du *DigestwUser, tl *TwTimeLine, resolveURL bool,
if k == (len(*tl) - 1) {
first = tmpSec
}
log.Printf("id:%d", v.Id)
//log.Printf("id:%d", v.Id)
}
sa.Foreach(update)
// decide to the next execution time
Expand Down
2 changes: 1 addition & 1 deletion web/tpl/index.html
Expand Up @@ -112,7 +112,7 @@ <h4>Try out</h4>
</ul>
<h4>Search</h4>
<form action="#" id="searchbox" class="s">
<input id="searchtxt" name="search" type="text" value="Type term and hit enter...">
<input id="searchtxt" name="search" type="text" value="Type user name...">
</form>
<h4>About the Author</h4>
<div id="c">
Expand Down
6 changes: 4 additions & 2 deletions web/web.go
Expand Up @@ -118,8 +118,9 @@ func genDayLinks(uid, val string) []*UnitStyle {
Class: STYLE_CLASS_SEL,
}
} else {
urlPath := &url.URL{Path: d}
ul = &UnitStyle{
Name: GenAnchorTagStr(d, "/web/stats/"+uid+"/day/"+url.QueryEscape(d)),
Name: GenAnchorTagStr(d, "/web/stats/"+uid+"/day/"+urlPath.EncodedPath()),
}
}
ret = append(ret, ul)
Expand Down Expand Up @@ -298,7 +299,8 @@ func onStats(ctx *web.Context, uid, unit, val string) {
}
bean.Units = append(bean.Units, &UnitStyle{Name: k, Class: STYLE_CLASS_SEL})
} else {
href := "/web/stats/" + uid + "/" + k + "/" + url.QueryEscape(unit2def[k])
urlPath := &url.URL{Path: unit2def[k]}
href := "/web/stats/" + uid + "/" + k + "/" + urlPath.EncodedPath()
anchor := GenAnchorTagStr(k, href)
bean.Units = append(bean.Units, &UnitStyle{Name: anchor, Class: STYLE_CLASS_NON})
}
Expand Down

0 comments on commit 95c9e1a

Please sign in to comment.