Skip to content

Commit 28875e6

Browse files
authored
Fixed wrong escaping on legacy MachineLogger (arduino#577)
Fix arduino#493 Fix arduino/Arduino#9287
1 parent 469b339 commit 28875e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

legacy/builder/i18n/i18n.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"io"
2121
"net/url"
2222
"os"
23-
"reflect"
2423
"regexp"
2524
"strconv"
2625
"strings"
@@ -209,9 +208,10 @@ func (s MachineLogger) UnformattedWrite(w io.Writer, data []byte) {
209208
func printMachineFormattedLogLine(w io.Writer, level string, format string, a []interface{}) {
210209
a = append([]interface{}(nil), a...)
211210
for idx, value := range a {
212-
typeof := reflect.Indirect(reflect.ValueOf(value)).Kind()
213-
if typeof == reflect.String {
214-
a[idx] = url.QueryEscape(value.(string))
211+
if str, ok := value.(string); ok {
212+
a[idx] = url.QueryEscape(str)
213+
} else if stringer, ok := value.(fmt.Stringer); ok {
214+
a[idx] = url.QueryEscape(stringer.String())
215215
}
216216
}
217217
fprintf(w, "===%s ||| %s ||| %s\n", level, format, a)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy