mirror of
https://github.com/friendica/friendica
synced 2025-04-27 01:50:11 +00:00
Issue 2880: Editing post doesn't destroy mentions or hashtags anymore
This commit is contained in:
parent
81089e1b2e
commit
3fe07cca57
3 changed files with 11 additions and 1 deletions
|
@ -14,6 +14,7 @@ use Friendica\Core\L10n;
|
|||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Event;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Profile;
|
||||
|
@ -1965,6 +1966,10 @@ function undo_post_tagging($s) {
|
|||
$cnt = preg_match_all('/([!#@])\[url=(.*?)\](.*?)\[\/url\]/ism', $s, $matches, PREG_SET_ORDER);
|
||||
if ($cnt) {
|
||||
foreach ($matches as $mtch) {
|
||||
if (in_array($mtch[1], ['!', '@'])) {
|
||||
$contact = Contact::getDetailsByURL($mtch[2]);
|
||||
$mtch[3] = empty($contact['addr']) ? $mtch[2] : $contact['addr'];
|
||||
}
|
||||
$s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue