]> git.mxchange.org Git - friendica.git/blob - mod/update_display.php
b8f3d8f498e64503c4df7f7eba65f12e459f2253
[friendica.git] / mod / update_display.php
1 <?php
2 /**
3  * @file mod/update_display.php
4  * See update_profile.php for documentation
5  */
6
7 use Friendica\App;
8 use Friendica\DI;
9
10 require_once "mod/display.php";
11
12 function update_display_content(App $a)
13 {
14         $profile_uid = intval($_GET["p"]);
15
16         header("Content-type: text/html");
17         echo "<!DOCTYPE html><html><body>\r\n";
18         echo "<section>";
19
20         $text = display_content($a, true, $profile_uid);
21
22         if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
23                 $replace = "<br />" . DI::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 }