Navigation Menu

Skip to content

Commit

Permalink
Don't encode html entities but escape quotes in JSON grid export. See h…
Browse files Browse the repository at this point in the history
  • Loading branch information
ansgarbecker committed Nov 26, 2016
1 parent 50d74d9 commit cdea092
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions source/exportgrid.pas
Expand Up @@ -681,9 +681,9 @@ procedure TfrmExportGrid.btnOKClick(Sender: TObject);
// JavaScript Object Notation
Header := '{' + CRLF;
if chkIncludeQuery.Checked then
Header := Header + #9 + '"query": "'+HTMLSpecialChars(GridData.SQL)+'",' + CRLF
Header := Header + #9 + '"query": '+EscapePHP(GridData.SQL)+',' + CRLF
else
Header := Header + #9 + '"table": "'+HTMLSpecialChars(TableName)+'",' + CRLF ;
Header := Header + #9 + '"table": '+EscapePHP(TableName)+',' + CRLF ;
Header := Header + #9 + '"rows":' + CRLF + #9 + '[';
end;

Expand Down Expand Up @@ -831,17 +831,15 @@ procedure TfrmExportGrid.btnOKClick(Sender: TObject);
efJSON: begin
tmp := tmp + #9#9#9;
if chkIncludeColumnNames.Checked then
tmp := tmp + EscapePHP(HTMLSpecialChars(Grid.Header.Columns[Col].Text)) + ': ';
tmp := tmp + EscapePHP(Grid.Header.Columns[Col].Text) + ': ';
if GridData.IsNull(Col) then
tmp := tmp + 'null,' +CRLF
else begin
case GridData.DataType(Col).Category of
dtcInteger, dtcReal:
tmp := tmp + data;
dtcBinary, dtcSpatial:
tmp := tmp + EscapePHP(Data);
tmp := tmp + Data;
else
tmp := tmp + EscapePHP(HTMLSpecialChars(Data))
tmp := tmp + EscapePHP(Data)
end;
tmp := tmp + ',' + CRLF;
end;
Expand Down

0 comments on commit cdea092

Please sign in to comment.