mirror of
https://github.com/friendica/friendica
synced 2025-04-26 19:50:10 +00:00
Replaced all preg calls in the calls with the new function
This commit is contained in:
parent
eeb8bee1b7
commit
4e77321be8
3 changed files with 19 additions and 87 deletions
|
@ -1401,23 +1401,12 @@ class Transmitter
|
|||
*/
|
||||
public static function getAnnounceArray($item)
|
||||
{
|
||||
if (!preg_match("/(.*?)\[share(.*?)\]\s?.*?\s?\[\/share\]\s?/ism", $item['body'], $matches)) {
|
||||
$reshared = Item::getShareArray($item);
|
||||
if (empty($reshared['guid'])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$attributes = $matches[2];
|
||||
$comment = $matches[1];
|
||||
|
||||
preg_match("/guid='(.*?)'/ism", $attributes, $matches);
|
||||
if (empty($matches[1])) {
|
||||
preg_match('/guid="(.*?)"/ism', $attributes, $matches);
|
||||
}
|
||||
|
||||
if (empty($matches[1])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$reshared_item = Item::selectFirst([], ['guid' => $matches[1]]);
|
||||
$reshared_item = Item::selectFirst([], ['guid' => $reshared['guid']]);
|
||||
if (!DBA::isResult($reshared_item)) {
|
||||
return [];
|
||||
}
|
||||
|
@ -1431,7 +1420,7 @@ class Transmitter
|
|||
return [];
|
||||
}
|
||||
|
||||
return ['object' => $reshared_item, 'actor' => $profile, 'comment' => trim($comment)];
|
||||
return ['object' => $reshared_item, 'actor' => $profile, 'comment' => $reshared['comment']];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue