From 742e7fd8bb786930b62df30eb8f64ff98c5a7dcf Mon Sep 17 00:00:00 2001 From: evilsocket Date: Sat, 16 Feb 2019 15:54:51 +0100 Subject: [PATCH] fix: single quotes can now be used to clear variables (fixes #450) --- session/session_core_handlers.go | 4 ++-- session/session_parse.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/session/session_core_handlers.go b/session/session_core_handlers.go index c2317d49..90b0b3d4 100644 --- a/session/session_core_handlers.go +++ b/session/session_core_handlers.go @@ -223,7 +223,7 @@ func (s *Session) setHandler(args []string, sess *Session) error { key := args[0] value := args[1] - if value == "\"\"" { + if value == "\"\"" || value == "''" { value = "" } @@ -240,7 +240,7 @@ func (s *Session) readHandler(args []string, sess *Session) error { value, _ := reader.ReadString('\n') value = str.Trim(value) - if value == "\"\"" { + if value == "\"\"" || value == "''" { value = "" } diff --git a/session/session_parse.go b/session/session_parse.go index 44ce5730..02bd9c75 100644 --- a/session/session_parse.go +++ b/session/session_parse.go @@ -16,6 +16,7 @@ func ParseCommands(line string) []string { finish := false line = strings.Replace(line, `""`, `""`, -1) + line = strings.Replace(line, `''`, `""`, -1) for _, c := range line { switch c { case ';':