| @@ 200-207 (lines=8) @@ | ||
| 197 | return "<a href=\"mailto:$email\">$email</a>"; |
|
| 198 | } |
|
| 199 | ||
| 200 | protected function renderUrl($block) |
|
| 201 | { |
|
| 202 | $url = htmlspecialchars($block[1], ENT_COMPAT | ENT_HTML401, 'UTF-8'); |
|
| 203 | $decodedUrl = urldecode($block[1]); |
|
| 204 | $secureUrlText = preg_match('//u', $decodedUrl) ? $decodedUrl : $block[1]; |
|
| 205 | $text = htmlspecialchars($secureUrlText, ENT_NOQUOTES | ENT_SUBSTITUTE, 'UTF-8'); |
|
| 206 | return "<a href=\"$url\">$text</a>"; |
|
| 207 | } |
|
| 208 | ||
| 209 | protected function lookupReference($key) |
|
| 210 | { |
|
| @@ 42-49 (lines=8) @@ | ||
| 39 | return [['text', substr($markdown, 0, 4)], 4]; |
|
| 40 | } |
|
| 41 | ||
| 42 | protected function renderAutoUrl($block) |
|
| 43 | { |
|
| 44 | $href = htmlspecialchars($block[1], ENT_COMPAT | ENT_HTML401, 'UTF-8'); |
|
| 45 | $decodedUrl = urldecode($block[1]); |
|
| 46 | $secureUrlText = preg_match('//u', $decodedUrl) ? $decodedUrl : $block[1]; |
|
| 47 | $text = htmlspecialchars($secureUrlText, ENT_NOQUOTES | ENT_SUBSTITUTE, 'UTF-8'); |
|
| 48 | return "<a href=\"$href\">$text</a>"; |
|
| 49 | } |
|
| 50 | } |
|
| 51 | ||