forked from GNUsocial/gnu-social
PCRE modifier /e is deprecated in favour of preg_replace_callback()
This commit is contained in:
@@ -428,8 +428,10 @@ class TwitterImport
|
||||
$statusId = twitter_id($status);
|
||||
common_log(LOG_WARNING, "No entities data for {$statusId}; trying to fake up links ourselves.");
|
||||
$text = common_replace_urls_callback($text, 'common_linkify');
|
||||
$text = preg_replace('/(^|\"\;|\'|\(|\[|\{|\s+)#([\pL\pN_\-\.]{1,64})/e', "'\\1#'.TwitterStatusFetcher::tagLink('\\2')", $text);
|
||||
$text = preg_replace('/(^|\s+)@([a-z0-9A-Z_]{1,64})/e', "'\\1@'.TwitterStatusFetcher::atLink('\\2')", $text);
|
||||
$text = preg_replace_callback('/(^|\"\;|\'|\(|\[|\{|\s+)#([\pL\pN_\-\.]{1,64})/',
|
||||
function ($m) { return $m[1].'#'.TwitterStatusFetcher::tagLink($m[2]); }, $text);
|
||||
$text = preg_replace_callback('/(^|\s+)@([a-z0-9A-Z_]{1,64})/',
|
||||
function ($m) { return $m[1].'@'.TwitterStatusFetcher::atLink($m[2]); }, $text);
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user