mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
fix chnage mode web
This commit is contained in:
+5
-2
@@ -269,11 +269,14 @@ var
|
||||
K: string;
|
||||
begin
|
||||
Result := '';
|
||||
K := '"' + Key + '"';
|
||||
// Ищем "key": — с двоеточием, чтобы не совпасть с "key" внутри значения
|
||||
// Например в {"cmd":"mode","mode":1} поиск "mode": не найдёт "mode" как значение cmd
|
||||
K := '"' + Key + '":';
|
||||
P := System.Pos(K, Json);
|
||||
if P = 0 then Exit;
|
||||
Inc(P, Length(K));
|
||||
while (P <= Length(Json)) and (Json[P] in [' ', ':']) do Inc(P);
|
||||
// Пропускаем пробелы после двоеточия
|
||||
while (P <= Length(Json)) and (Json[P] = ' ') do Inc(P);
|
||||
if P > Length(Json) then Exit;
|
||||
if Json[P] = '"' then
|
||||
begin
|
||||
|
||||
Reference in New Issue
Block a user