bskyweb: fix post text expansion
This commit is contained in:
@@ -23,7 +23,9 @@ func ExpandPostText(post *appbsky.FeedPost) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// bail out if bounds checks fail
|
// bail out if bounds checks fail
|
||||||
if int(facet.Index.ByteStart)+charsAdded > len(postText) || int(facet.Index.ByteEnd)+charsAdded > len(postText) {
|
if facet.Index.ByteStart > facet.Index.ByteEnd ||
|
||||||
|
int(facet.Index.ByteStart)+charsAdded > len(postText) ||
|
||||||
|
int(facet.Index.ByteEnd)+charsAdded > len(postText) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
linkText := postText[int(facet.Index.ByteStart)+charsAdded : int(facet.Index.ByteEnd)+charsAdded]
|
linkText := postText[int(facet.Index.ByteStart)+charsAdded : int(facet.Index.ByteEnd)+charsAdded]
|
||||||
|
|||||||
Reference in New Issue
Block a user