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