mirror of
https://github.com/friendica/friendica
synced 2025-04-23 11:50:12 +00:00
Functionality is now split
This commit is contained in:
parent
4528d8748c
commit
3ab837f3c7
13 changed files with 71 additions and 1727 deletions
|
@ -4844,70 +4844,69 @@ function api_share_as_retweet(&$item)
|
|||
/// @TODO "$1" should maybe mean '$1' ?
|
||||
$attributes = preg_replace("/\[share(.*?)\]\s?(.*?)\s?\[\/share\]\s?/ism", "$1", $body);
|
||||
/*
|
||||
* Skip if there is no shared message in there
|
||||
* we already checked this in diaspora::isReshare()
|
||||
* but better one more than one less...
|
||||
*/
|
||||
if ($body == $attributes) {
|
||||
* Skip if there is no shared message in there
|
||||
* we already checked this in diaspora::isReshare()
|
||||
* but better one more than one less...
|
||||
*/
|
||||
if (($body == $attributes) || empty($attributes)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// build the fake reshared item
|
||||
$reshared_item = $item;
|
||||
|
||||
$author = "";
|
||||
preg_match("/author='(.*?)'/ism", $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$author = html_entity_decode($matches[1], ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
|
||||
preg_match('/author="(.*?)"/ism', $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$author = $matches[1];
|
||||
}
|
||||
|
||||
$profile = "";
|
||||
preg_match("/profile='(.*?)'/ism", $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$profile = $matches[1];
|
||||
}
|
||||
|
||||
preg_match('/profile="(.*?)"/ism', $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$profile = $matches[1];
|
||||
}
|
||||
|
||||
$avatar = "";
|
||||
preg_match("/avatar='(.*?)'/ism", $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$avatar = $matches[1];
|
||||
}
|
||||
|
||||
preg_match('/avatar="(.*?)"/ism', $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$avatar = $matches[1];
|
||||
}
|
||||
|
||||
$link = "";
|
||||
preg_match("/link='(.*?)'/ism", $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$link = $matches[1];
|
||||
}
|
||||
|
||||
preg_match('/link="(.*?)"/ism', $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$link = $matches[1];
|
||||
}
|
||||
|
||||
$posted = "";
|
||||
preg_match("/posted='(.*?)'/ism", $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$posted = $matches[1];
|
||||
}
|
||||
|
||||
preg_match('/posted="(.*?)"/ism', $attributes, $matches);
|
||||
if ($matches[1] != "") {
|
||||
if (!empty($matches[1])) {
|
||||
$posted = $matches[1];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue