X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fupdate_contact.php;h=1a85018e6d23645842f9b261e3c4a00364014ef5;hb=1ede164450f2651a2ea04dcb16af113459393663;hp=361234fea77820ed8d6192e412e88f0d7c0d076f;hpb=93d50af700e94d3f099559f86c31b406520fc309;p=friendica.git diff --git a/mod/update_contact.php b/mod/update_contact.php index 361234fea7..1a85018e6d 100644 --- a/mod/update_contact.php +++ b/mod/update_contact.php @@ -1,38 +1,47 @@ . + * + * See update_profile.php for documentation + * + */ use Friendica\App; -use Friendica\Core\L10n; -use Friendica\Core\PConfig; -use Friendica\Module\Contact; +use Friendica\Core\System; +use Friendica\Database\DBA; +use Friendica\DI; +use Friendica\Model\Post; +use Friendica\Model\Contact; function update_contact_content(App $a) { - header("Content-type: text/html"); - echo "\r\n"; - echo "
"; + if (!empty(DI::args()->get(1)) && !empty($_GET['force'])) { + $contact = Contact::getById(DI::args()->get(1), ['id', 'deleted']); + if (DBA::isResult($contact) && empty($contact['deleted'])) { + DI::page()['aside'] = ''; - if ($_GET["force"] == 1) { - $text = Contact::content($a, true); - } else { - $text = ''; - } + if (!empty($_GET['item'])) { + $item = Post::selectFirst(['parent'], ['id' => $_GET['item']]); + } - if (PConfig::get(local_user(), "system", "bandwidth_saver")) { - $replace = "
".L10n::t("[Embedded content - reload page to view]")."
"; - $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i"; - $text = preg_replace($pattern, $replace, $text); - $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i"; - $text = preg_replace($pattern, $replace, $text); - $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i"; - $text = preg_replace($pattern, $replace, $text); - $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i"; - $text = preg_replace($pattern, $replace, $text); + $text = Contact::getPostsFromId($contact['id'], true, true, $item['parent'] ?? 0); + } } - echo str_replace("\t", " ", $text); - echo "
"; - echo "\r\n"; - killme(); + System::htmlUpdateExit($text ?? ''); }