From ae2a885d6c1e912a4e53140f5601d0370eb8bab9 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 20 Mar 2015 11:00:22 +0000 Subject: [PATCH] fixed: rm winix function returned incorrectly formated json when using jquery upload (delete file button) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1006 e52654a7-88a9-db11-a3e9-0013d4bc506e --- functions/rm.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/functions/rm.cpp b/functions/rm.cpp index af1e2e6..7cbb944 100644 --- a/functions/rm.cpp +++ b/functions/rm.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2008-2014, Tomasz Sowa + * Copyright (c) 2008-2015, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -493,18 +493,20 @@ void Rm::Clear() void Rm::CreateJSON(bool status) { - auto & out = cur->request->out_streams[0]; +using TemplatesFunctions::R; +PT::WTextStream buf; - out << "{\"files\": [{\""; - JSONescape(out, cur->request->item.url); - out << "\": "; + JSONescape(buf, cur->request->item.url); + + auto & out = cur->request->out_streams[0]; + out << R("{\"files\": [{\"") << R(buf) << R("\": "); if( status ) - out << "true"; + out << R("true"); else - out << "false"; + out << R("false"); - out << "}]}"; + out << R("}]}"); cur->request->page_generated = true; cur->request->use_html_filter[0] = false;