| @@ -47,23 +47,26 @@ | ||
| 47 | 47 | <?php if (count($logs)) : ?> |
| 48 | 48 | <?php foreach ($logs as $key => $log) : ?> |
| 49 | 49 | |
| 50 | 50 | <tr> |
| 51 | - <td><?php echo sanitize_text_field($log->action) ?></td> | |
| 52 | - <td><?php echo sanitize_text_field($log->context) ?></td> | |
| 51 | + <td><?php echo esc_html($log->action) ?></td> | |
| 52 | + <td><?php echo esc_html($log->context) ?></td> | |
| 53 | 53 | <td class="break-long"> |
| 54 | - <div style="margin-bottom: 5px;"><?php echo sanitize_text_field($log->action_username ?? $log->action_user_id) ?></div> | |
| 55 | - <?php echo sanitize_text_field($log->ip_address) ?> | |
| 54 | + <div style="margin-bottom: 5px;"><?php echo esc_html($log->action_username ?? $log->action_user_id) ?></div> | |
| 55 | + <?php echo esc_html($log->ip_address) ?> | |
| 56 | 56 | </td> |
| 57 | 57 | <td> |
| 58 | 58 | <small> |
| 59 | - <?php echo logtivity_datetime($log->occurred_at); ?> | |
| 59 | + <?php echo esc_html(logtivity_datetime($log->occurred_at)); ?> | |
| 60 | 60 | </small> |
| 61 | 61 | </td> |
| 62 | 62 | <td class="text-center"> |
| 63 | 63 | <button type="button" class="button js-logtivity-view-log" aria-haspopup="dialog" aria-controls="logtivity-log-modal" aria-label="<?php esc_attr_e('View log details', 'logtivity'); ?>">View</button> |
| 64 | 64 | <div style="display: none;" class="js-modal-content"> |
| 65 | - <?php echo logtivity_view('_log-show', ['log' => $log,]) ?> | |
| 65 | + <?php | |
| 66 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- logtivity_view() renders trusted plugin templates. | |
| 67 | + echo logtivity_view('_log-show', ['log' => $log,]); | |
| 68 | + ?> | |
| 66 | 69 | </div> |
| 67 | 70 | </td> |
| 68 | 71 | </tr> |
| 69 | 72 | |
| @@ -69,9 +72,9 @@ | ||
| 69 | 72 | |
| 70 | 73 | <?php endforeach ?> |
| 71 | 74 | <?php elseif (isset($message)) : ?> |
| 72 | 75 | <tr> |
| 73 | - <td colspan="5"><?php echo sanitize_text_field($message) ?></td> | |
| 76 | + <td colspan="5"><?php echo esc_html($message) ?></td> | |
| 74 | 77 | </tr> |
| 75 | 78 | <?php else : ?> |
| 76 | 79 | <tr> |
| 77 | 80 | <td colspan="5">No results found.</td> |