]> git.mxchange.org Git - friendica.git/blob - mod/update_contact.php
Force avatar update for Contact Advanced page
[friendica.git] / mod / update_contact.php
1 <?php
2
3 // See update_profile.php for documentation
4
5 use Friendica\App;
6 use Friendica\DI;
7 use Friendica\Module\Contact;
8
9 function update_contact_content(App $a)
10 {
11         header("Content-type: text/html");
12         echo "<!DOCTYPE html><html><body>\r\n";
13         echo "<section>";
14
15         if ($_GET["force"] == 1) {
16                 $text = Contact::content([], true);
17         } else {
18                 $text = '';
19         }
20
21         if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
22                 $replace = "<br />" . DI::l10n()->t("[Embedded content - reload page to view]") . "<br />";
23                 $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
24                 $text = preg_replace($pattern, $replace, $text);
25                 $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
26                 $text = preg_replace($pattern, $replace, $text);
27                 $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
28                 $text = preg_replace($pattern, $replace, $text);
29                 $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
30                 $text = preg_replace($pattern, $replace, $text);
31         }
32
33         echo str_replace("\t", "       ", $text);
34         echo "</section>";
35         echo "</body></html>\r\n";
36         exit();
37 }