Skip to content

Commit b706a2c

Browse files
committed
Fix escape
1 parent d5ee040 commit b706a2c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

phpunit.ci.xml

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
convertErrorsToExceptions="true"
44
convertNoticesToExceptions="true"
55
convertWarningsToExceptions="true"
6-
strict="true"
7-
syntaxCheck="true"
86
>
97
<php>
108
<ini name="error_reporting" value="-1" />

src/Autolink.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ public function link(string $url, array $attribs = []): string
185185
}
186186

187187
if ($this->isAutoTitle()) {
188-
$attribs['title'] = htmlspecialchars($url);
188+
$attribs['title'] = htmlspecialchars(
189+
$url,
190+
// PHP 8.1 or higher will escape single quote
191+
ENT_QUOTES | ENT_SUBSTITUTE
192+
);
189193
}
190194

191195
return $this->buildLink($content, $attribs);

0 commit comments

Comments
 (0)