|
19 | 19 | <!-- Header --> |
20 | 20 | <div class="header"> |
21 | 21 | <div class="container"> |
22 | | - <h1><?= htmlspecialchars($title, ENT_SUBSTITUTE, 'UTF-8'), ($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1> |
| 22 | + <h1><?= htmlspecialchars($title, ENT_SUBSTITUTE, 'UTF-8'), esc($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1> |
23 | 23 | <p> |
24 | | - <?= $exception->getMessage() ?> |
| 24 | + <?= esc($exception->getMessage()) ?> |
25 | 25 | <a href="https://www.google.com/search?q=<?= urlencode($title . ' ' . preg_replace('#\'.*\'|".*"#Us', '', $exception->getMessage())) ?>" |
26 | 26 | rel="noreferrer" target="_blank">search →</a> |
27 | 27 | </p> |
|
30 | 30 |
|
31 | 31 | <!-- Source --> |
32 | 32 | <div class="container"> |
33 | | - <p><b><?= static::cleanPath($file, $line) ?></b> at line <b><?= $line ?></b></p> |
| 33 | + <p><b><?= esc(static::cleanPath($file, $line)) ?></b> at line <b><?= esc($line) ?></b></p> |
34 | 34 |
|
35 | 35 | <?php if (is_file($file)) : ?> |
36 | 36 | <div class="source"> |
|
66 | 66 | <?php |
67 | 67 | if (isset($row['function']) && in_array($row['function'], ['include', 'include_once', 'require', 'require_once'], true)) |
68 | 68 | { |
69 | | - echo $row['function'] . ' ' . static::cleanPath($row['file']); |
| 69 | + echo esc($row['function'] . ' ' . static::cleanPath($row['file'])); |
70 | 70 | } |
71 | 71 | else |
72 | 72 | { |
73 | | - echo static::cleanPath($row['file']) . ' : ' . $row['line']; |
| 73 | + echo esc(static::cleanPath($row['file']) . ' : ' . $row['line']); |
74 | 74 | } |
75 | 75 | ?> |
76 | 76 | <?php else : ?> |
|
79 | 79 |
|
80 | 80 | <!-- Class/Method --> |
81 | 81 | <?php if (isset($row['class'])) : ?> |
82 | | - — <?= $row['class'] . $row['type'] . $row['function'] ?> |
| 82 | + — <?= esc($row['class'] . $row['type'] . $row['function']) ?> |
83 | 83 | <?php if (! empty($row['args'])) : ?> |
84 | 84 | <?php $args_id = $error_id . 'args' . $index ?> |
85 | | - ( <a href="#" onclick="return toggle('<?= $args_id ?>');">arguments</a> ) |
86 | | - <div class="args" id="<?= $args_id ?>"> |
| 85 | + ( <a href="#" onclick="return toggle('<?= esc($args_id, 'attr') ?>');">arguments</a> ) |
| 86 | + <div class="args" id="<?= esc($args_id, 'attr') ?>"> |
87 | 87 | <table cellspacing="0"> |
88 | 88 |
|
89 | 89 | <?php |
|
109 | 109 | <?php endif; ?> |
110 | 110 |
|
111 | 111 | <?php if (! isset($row['class']) && isset($row['function'])) : ?> |
112 | | - — <?= $row['function'] ?>() |
| 112 | + — <?= esc($row['function']) ?>() |
113 | 113 | <?php endif; ?> |
114 | 114 | </p> |
115 | 115 |
|
|
134 | 134 | continue; |
135 | 135 | } ?> |
136 | 136 |
|
137 | | - <h3>$<?= $var ?></h3> |
| 137 | + <h3>$<?= esc($var) ?></h3> |
138 | 138 |
|
139 | 139 | <table> |
140 | 140 | <thead> |
|
199 | 199 | <tbody> |
200 | 200 | <tr> |
201 | 201 | <td style="width: 10em">Path</td> |
202 | | - <td><?= $request->uri ?></td> |
| 202 | + <td><?= esc($request->uri) ?></td> |
203 | 203 | </tr> |
204 | 204 | <tr> |
205 | 205 | <td>HTTP Method</td> |
206 | | - <td><?= $request->getMethod(true) ?></td> |
| 206 | + <td><?= esc($request->getMethod(true)) ?></td> |
207 | 207 | </tr> |
208 | 208 | <tr> |
209 | 209 | <td>IP Address</td> |
210 | | - <td><?= $request->getIPAddress() ?></td> |
| 210 | + <td><?= esc($request->getIPAddress()) ?></td> |
211 | 211 | </tr> |
212 | 212 | <tr> |
213 | 213 | <td style="width: 10em">Is AJAX Request?</td> |
|
223 | 223 | </tr> |
224 | 224 | <tr> |
225 | 225 | <td>User Agent</td> |
226 | | - <td><?= $request->getUserAgent()->getAgentString() ?></td> |
| 226 | + <td><?= esc($request->getUserAgent()->getAgentString()) ?></td> |
227 | 227 | </tr> |
228 | 228 |
|
229 | 229 | </tbody> |
|
239 | 239 |
|
240 | 240 | <?php $empty = false; ?> |
241 | 241 |
|
242 | | - <h3>$<?= $var ?></h3> |
| 242 | + <h3>$<?= esc($var) ?></h3> |
243 | 243 |
|
244 | 244 | <table style="width: 100%"> |
245 | 245 | <thead> |
|
318 | 318 | <table> |
319 | 319 | <tr> |
320 | 320 | <td style="width: 15em">Response Status</td> |
321 | | - <td><?= $response->getStatusCode() . ' - ' . $response->getReason() ?></td> |
| 321 | + <td><?= esc($response->getStatusCode() . ' - ' . $response->getReason()) ?></td> |
322 | 322 | </tr> |
323 | 323 | </table> |
324 | 324 |
|
|
366 | 366 | <tbody> |
367 | 367 | <tr> |
368 | 368 | <td>Memory Usage</td> |
369 | | - <td><?= static::describeMemory(memory_get_usage(true)) ?></td> |
| 369 | + <td><?= esc(static::describeMemory(memory_get_usage(true))) ?></td> |
370 | 370 | </tr> |
371 | 371 | <tr> |
372 | 372 | <td style="width: 12em">Peak Memory Usage:</td> |
373 | | - <td><?= static::describeMemory(memory_get_peak_usage(true)) ?></td> |
| 373 | + <td><?= esc(static::describeMemory(memory_get_peak_usage(true))) ?></td> |
374 | 374 | </tr> |
375 | 375 | <tr> |
376 | 376 | <td>Memory Limit:</td> |
377 | | - <td><?= ini_get('memory_limit') ?></td> |
| 377 | + <td><?= esc(ini_get('memory_limit')) ?></td> |
378 | 378 | </tr> |
379 | 379 | </tbody> |
380 | 380 | </table> |
|
389 | 389 | <div class="container"> |
390 | 390 |
|
391 | 391 | <p> |
392 | | - Displayed at <?= date('H:i:sa') ?> — |
393 | | - PHP: <?= phpversion() ?> — |
394 | | - CodeIgniter: <?= \CodeIgniter\CodeIgniter::CI_VERSION ?> |
| 392 | + Displayed at <?= esc(date('H:i:sa')) ?> — |
| 393 | + PHP: <?= esc(phpversion()) ?> — |
| 394 | + CodeIgniter: <?= esc(\CodeIgniter\CodeIgniter::CI_VERSION) ?> |
395 | 395 | </p> |
396 | 396 |
|
397 | 397 | </div> |
|
0 commit comments