blob: 3ffa7ace1bbfe4fbf50c9718df9f1ea1d3c0dd57 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package proxy
import (
"regexp"
"strings"
)
var textureName = regexp.MustCompile("[a-zA-Z0-9-_.]*\\.[a-zA-Z-_.]+")
func (sc *ServerConn) prependFormspec(fs *string) {
subs := disallowedChars.Split(*fs, -1)
seps := disallowedChars.FindAllString(*fs, -1)
for i, sub := range subs {
if textureName.MatchString(sub) && !strings.Contains(sub, " ") {
prepend(sc.mediaPool, &subs[i])
}
}
*fs = ""
for i, sub := range subs {
*fs += sub
if i < len(seps) {
*fs += seps[i]
}
}
}
|