Now we are having "after" at the old attach mechanism as well
This commit is contained in:
parent
3e76ad7793
commit
432c1ec5e4
1 changed files with 8 additions and 2 deletions
|
@ -8,7 +8,8 @@ require_once("include/Photo.php");
|
|||
* @param string $body Message body
|
||||
* @return array
|
||||
* 'type' -> Message type ("link", "video", "photo")
|
||||
* 'text' -> Text outside of the shared message
|
||||
* 'text' -> Text before the shared message
|
||||
* 'after' -> Text after the shared message
|
||||
* 'image' -> Preview image of the message
|
||||
* 'url' -> Url to the attached message
|
||||
* 'title' -> Title of the attachment
|
||||
|
@ -28,6 +29,11 @@ function get_old_attachment_data($body) {
|
|||
|
||||
$post["type"] = substr($data[1], 5);
|
||||
|
||||
$pos = strpos($body, $data[0]);
|
||||
if ($pos > 0) {
|
||||
$post["text"] = trim(substr($body, 0, $pos));
|
||||
$post["after"] = trim(substr($body, $pos + strlen($data[0])));
|
||||
} else
|
||||
$post["text"] = trim(str_replace($data[0], "", $body));
|
||||
|
||||
$attacheddata = $data[2];
|
||||
|
|
Loading…
Reference in a new issue