From 6d14be18b09e83cea4c049f6f3e7c9771b04eda6 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Wed, 28 Jun 2017 10:32:35 +0100 Subject: [#3079] Fix config parsing for json objects * If a curly brace was used in a string then find_json_ojects would fail to find objects correctly. To fix this ignore double-quoted entries. --- deluge/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deluge/config.py b/deluge/config.py index 40095139e..c893bd83b 100644 --- a/deluge/config.py +++ b/deluge/config.py @@ -111,8 +111,13 @@ def find_json_objects(s): if start < 0: return [] + quoted = False for index, c in enumerate(s[offset:]): - if c == "{": + if c == '"': + quoted = not quoted + elif quoted: + continue + elif c == "{": opens += 1 elif c == "}": opens -= 1 -- cgit