Skip to content

Commit 39eb208

Browse files
committed
fix twitter url parsing, closes #22
1 parent 8efcfec commit 39eb208

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

classes/Meta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function twitterSite()
176176
// tries to match all twitter urls, and extract the username
177177
$matches = [];
178178
preg_match('/^(https?:\/\/)?(www\.)?twitter\.com\/(#!\/)?@?(?<name>[^\/\?]*)$/', $accs->twitter()->value(), $matches);
179-
$username = $matches['name'];
179+
if (isset($matches['name'])) $username = $matches['name'];
180180
}
181181

182182
return new Field($this->page, 'twitter', $username);

0 commit comments

Comments
 (0)