mirror of
https://github.com/astaxie/beego.git
synced 2025-07-07 02:00:20 +00:00
beego: template fund when the start> len(bt)
This commit is contained in:
@ -27,6 +27,9 @@ func Substr(s string, start, length int) string {
|
||||
if start < 0 {
|
||||
start = 0
|
||||
}
|
||||
if start > len(bt) {
|
||||
start = start % len(bt)
|
||||
}
|
||||
var end int
|
||||
if (start + length) > (len(bt) - 1) {
|
||||
end = len(bt)
|
||||
|
Reference in New Issue
Block a user