MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / escape

Function escape

server/webdav/xml.go:104–114  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

102}
103
104func escape(s string) string {
105 for i := 0; i < len(s); i++ {
106 switch s[i] {
107 case '"', '&', '\'', '<', '>':
108 b := bytes.NewBuffer(nil)
109 ixml.EscapeText(b, []byte(s))
110 return b.String()
111 }
112 }
113 return s
114}
115
116// Next returns the next token, if any, in the XML stream of d.
117// RFC 4918 requires to ignore comments, processing instructions

Callers 1

writeLockInfoFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected