X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fupdate_contact.php;h=8eeb9facf1b81f7c2d83f7a0f4345d0ef32d4f5b;hb=b5d2d32b443f7aa8ec6e0e91f36da3cc0a0f2a82;hp=bea33b4841f96286ffd4c9ff4a86b93c5a0e23fa;hpb=c961128416390dab45bd5bd88ec4bf7823394413;p=friendica.git
diff --git a/mod/update_contact.php b/mod/update_contact.php
index bea33b4841..8eeb9facf1 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']) || !DI::pConfig()->get(local_user(), 'system', 'no_auto_update'))) {
+ $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([], 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";
- exit();
+ System::htmlUpdateExit($text ?? '');
}