New function to convert BBCode for a given ID

This commit is contained in:
Michael 2021-07-08 13:47:46 +00:00
parent f3452d86c4
commit f29bd23ea8
15 changed files with 145 additions and 38 deletions

View file

@ -1886,7 +1886,7 @@ class Contact
{
if (Strings::normaliseLink($new_url) != Strings::normaliseLink($old_url)) {
Logger::notice('New URL differs from old URL', ['old' => $old_url, 'new' => $new_url]);
// @todo It is to decide what to do when the URL is changed
return;
}
if (!DBA::update('contact', $fields, ['id' => $id])) {
@ -2073,6 +2073,14 @@ class Contact
return false;
}
if (Strings::normaliseLink($ret['url']) != Strings::normaliseLink($contact['url'])) {
$cid = self::getIdForURL($ret['url']);
if (!empty($cid) && ($cid != $id)) {
Logger::notice('URL of contact changed.', ['id' => $id, 'new_id' => $cid, 'old' => $contact['url'], 'new' => $ret['url']]);
return self::updateFromProbeArray($cid, $ret);
}
}
if (isset($ret['hide']) && is_bool($ret['hide'])) {
$ret['unsearchable'] = $ret['hide'];
}