]> git.mxchange.org Git - friendica.git/blob - mod/update_network.php
Move /profile_photo to Module\Settings\Profile\Photo
[friendica.git] / mod / update_network.php
1 <?php
2 /**
3  * @file mod/update_network
4  * See update_profile.php for documentation
5  */
6
7 use Friendica\App;
8 use Friendica\DI;
9
10 require_once "mod/network.php";
11
12 function update_network_content(App $a)
13 {
14         if (!isset($_GET['p']) || !isset($_GET['item'])) {
15                 exit();
16         }
17
18         $profile_uid = intval($_GET['p']);
19         $parent = intval($_GET['item']);
20
21         header("Content-type: text/html");
22         echo "<!DOCTYPE html><html><body>\r\n";
23         echo "<section>";
24
25         if (!DI::pConfig()->get($profile_uid, "system", "no_auto_update") || ($_GET["force"] == 1)) {
26                 $text = network_content($a, $profile_uid, $parent);
27         } else {
28                 $text = "";
29         }
30
31         if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
32                 $replace = "<br />" . DI::l10n()->t("[Embedded content - reload page to view]") . "<br />";
33                 $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
34                 $text = preg_replace($pattern, $replace, $text);
35                 $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
36                 $text = preg_replace($pattern, $replace, $text);
37                 $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
38                 $text = preg_replace($pattern, $replace, $text);
39                 $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
40                 $text = preg_replace($pattern, $replace, $text);
41         }
42
43         echo str_replace("\t", "       ", $text);
44         echo "</section>";
45         echo "</body></html>\r\n";
46         exit();
47 }