}
if (!$matches && $searchNakedUrls) {
- preg_match('~(?<=\W|^)(?<![=\]])(https?://.+)$~is', $body, $matches);
+ preg_match(Strings::autoLinkRegEx(), $body, $matches);
if ($matches && !Strings::endsWith($body, $matches[1])) {
unset($matches);
}
$quotedUrl
)$#isx", function ($match) use ($url) {
// Stripping URLs with no label
- if (!isset($match[1])) {
+ if (empty($match[1])) {
return '';
}