Merge #20080 - Fix # 20068 - Do not html encode triggers or events for ajax requests
Pull-request: #20080 Fixes #20068 Co-Authored-by: William Desportes <williamdes@wdes.fr> Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
ac1fbe1c17
@ -211,9 +211,9 @@ final class EventsController implements InvocableController
|
||||
$exportData = false;
|
||||
}
|
||||
|
||||
$itemName = htmlspecialchars(Util::backquote($itemName));
|
||||
$itemName = Util::backquote($itemName);
|
||||
if ($exportData !== false) {
|
||||
$exportData = htmlspecialchars(trim($exportData));
|
||||
$exportData = trim($exportData);
|
||||
$title = sprintf(__('Export of event %s'), $itemName);
|
||||
|
||||
if ($request->isAjax()) {
|
||||
@ -223,6 +223,8 @@ final class EventsController implements InvocableController
|
||||
return $this->response->response();
|
||||
}
|
||||
|
||||
$exportData = htmlspecialchars($exportData);
|
||||
|
||||
$output = '<div class="container">';
|
||||
$output .= '<h2>' . $title . '</h2>';
|
||||
$output .= '<div class="card"><div class="card-body">';
|
||||
@ -233,7 +235,7 @@ final class EventsController implements InvocableController
|
||||
} else {
|
||||
$message = sprintf(
|
||||
__('Error in processing request: No event with name %1$s found in database %2$s.'),
|
||||
$itemName,
|
||||
htmlspecialchars($itemName),
|
||||
htmlspecialchars(Util::backquote(Current::$database)),
|
||||
);
|
||||
$message = Message::error($message);
|
||||
|
||||
@ -230,9 +230,9 @@ final class IndexController implements InvocableController
|
||||
$triggerName->getName(),
|
||||
)?->getCreateSql('');
|
||||
if ($exportData !== null && $request->isAjax()) {
|
||||
$title = sprintf(__('Export of trigger %s'), htmlspecialchars(Util::backquote($triggerName)));
|
||||
$title = sprintf(__('Export of trigger %s'), Util::backquote($triggerName));
|
||||
$this->response->addJSON('title', $title);
|
||||
$this->response->addJSON('message', htmlspecialchars(trim($exportData)));
|
||||
$this->response->addJSON('message', trim($exportData));
|
||||
|
||||
return $this->response->response();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user