Skip to content

Commit

Permalink
Fixed regex escaping issue in table
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanheywood committed Nov 13, 2024
1 parent ef2af35 commit 3fa53bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/search_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@ public function col_userid(stdClass $record): string {
public function col_search(stdClass $record): string {
$class = 'border p-1 d-inline';
$style = 'white-space: pre-wrap;';
return \html_writer::tag('pre', $record->search, ['class' => $class, 'style' => $style]);
$html = \html_writer::start_tag('pre', ['class' => $class, 'style' => $style]);
$html .= htmlspecialchars($record->search);
$html .= \html_writer::end_tag('pre');
return $html;
}

/**
Expand Down

0 comments on commit 3fa53bd

Please sign in to comment.