]> git.mxchange.org Git - friendica.git/blob - mod/update_display.php
Move PConfig::get() to DI::pConfig()->get()
[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\Core\L10n;
9 use Friendica\Core\PConfig;
10 use Friendica\DI;
11
12 require_once "mod/display.php";
13
14 function update_display_content(App $a)
15 {
16         $profile_uid = intval($_GET["p"]);
17
18         header("Content-type: text/html");
19         echo "<!DOCTYPE html><html><body>\r\n";
20         echo "<section>";
21
22         $text = display_content($a, true, $profile_uid);
23
24         if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
25                 $replace = "<br />" . L10n::t("[Embedded content - reload page to view]") . "<br />";
26                 $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
27                 $text = preg_replace($pattern, $replace, $text);
28                 $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
29                 $text = preg_replace($pattern, $replace, $text);
30                 $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
31                 $text = preg_replace($pattern, $replace, $text);
32                 $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
33                 $text = preg_replace($pattern, $replace, $text);
34         }
35
36         echo str_replace("\t", "       ", $text);
37         echo "</section>";
38         echo "</body></html>\r\n";
39         exit();
40 }