We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 139986a commit 49de4f6Copy full SHA for 49de4f6
src/Autolink.php
@@ -101,19 +101,21 @@ function($matches) use ($self, $attribs)
101
*/
102
public function convertEmail($text, $attribs = array())
103
{
104
+ $self = $this;
105
+
106
$regex = "/(([a-zA-Z]*=\")*\S+@\S+\.\S+)/";
107
108
return preg_replace_callback(
109
$regex,
- function($matches) use ($attribs)
110
+ function($matches) use ($self, $attribs)
111
112
preg_match('/[a-zA-Z]*\=\"(.*)/', $matches[0], $inElements);
113
114
if (!$inElements)
115
116
$attribs['href'] = 'mailto:' . htmlspecialchars($matches[0]);
117
- return $this->buildLink($matches[0], $attribs);
118
+ return $self->buildLink($matches[0], $attribs);
119
}
120
121
return $matches[0];
0 commit comments