From 70fc2611bd511a82b2534a26f6e508bb0d7f8799 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 2 Oct 2019 20:37:24 +0200 Subject: [PATCH] webconfig: Escape abbrs properly Fixes #6120 --- share/tools/web_config/webconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index 1832f19ac..7d2107197 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -1189,7 +1189,8 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_save_abbreviation(self, abbreviation): out, err = run_fish_cmd( - "abbr --add '%s' '%s'" % (abbreviation["word"], abbreviation["phrase"]) + # Remove one layer of single-quotes because escape_fish_cmd adds them back. + "abbr --add %s %s" % (escape_fish_cmd(abbreviation["word"].strip("'")), escape_fish_cmd(abbreviation["phrase"].strip("'"))) ) if err: return err