mirror of
https://github.com/itflow-org/itflow
synced 2026-03-19 12:14:50 +00:00
Merge pull request #663 from wrongecho/ticket-edit-strip-html
Sanitize ticket details output in main edit modal
This commit is contained in:
@@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<textarea class="form-control summernote" rows="8" name="details" required><?php echo $ticket_details; ?></textarea>
|
<textarea class="form-control summernote" rows="8" name="details" required><?php echo htmlentities($ticket_details); ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ $o = "DESC";
|
|||||||
|
|
||||||
require_once("inc_all.php");
|
require_once("inc_all.php");
|
||||||
|
|
||||||
|
//Initialize the HTML Purifier to prevent XSS
|
||||||
|
require("plugins/htmlpurifier/HTMLPurifier.standalone.php");
|
||||||
|
$purifier_config = HTMLPurifier_Config::createDefault();
|
||||||
|
$purifier_config->set('URI.AllowedSchemes', ['data' => true, 'src' => true, 'http' => true, 'https' => true]);
|
||||||
|
$purifier = new HTMLPurifier($purifier_config);
|
||||||
|
|
||||||
// Ticket status from GET
|
// Ticket status from GET
|
||||||
if (!isset($_GET['status'])) {
|
if (!isset($_GET['status'])) {
|
||||||
// If nothing is set, assume we only want to see open tickets
|
// If nothing is set, assume we only want to see open tickets
|
||||||
@@ -261,7 +267,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
|
|||||||
$ticket_prefix = htmlentities($row['ticket_prefix']);
|
$ticket_prefix = htmlentities($row['ticket_prefix']);
|
||||||
$ticket_number = intval($row['ticket_number']);
|
$ticket_number = intval($row['ticket_number']);
|
||||||
$ticket_subject = htmlentities($row['ticket_subject']);
|
$ticket_subject = htmlentities($row['ticket_subject']);
|
||||||
$ticket_details = htmlentities($row['ticket_details']);
|
$ticket_details = $purifier->purify($row['ticket_details']);
|
||||||
$ticket_priority = htmlentities($row['ticket_priority']);
|
$ticket_priority = htmlentities($row['ticket_priority']);
|
||||||
$ticket_status = htmlentities($row['ticket_status']);
|
$ticket_status = htmlentities($row['ticket_status']);
|
||||||
$ticket_created_at = htmlentities($row['ticket_created_at']);
|
$ticket_created_at = htmlentities($row['ticket_created_at']);
|
||||||
|
|||||||
Reference in New Issue
Block a user