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