fix chnage mode web

This commit is contained in:
2026-03-06 00:29:16 +03:00
parent 4e171c3d35
commit 19b4efea6b
3 changed files with 24 additions and 12 deletions
+5 -2
View File
@@ -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