]> git.mxchange.org Git - friendica.git/blob - mod/update_network.php
Merge pull request #4046 from MrPetovan/bug/4041-fix-register
[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 "mod/network.php";
9
10 function update_network_content(App $a)
11 {
12         $profile_uid = intval($_GET["p"]);
13
14         header("Content-type: text/html");
15         echo "<!DOCTYPE html><html><body>\r\n";
16         echo "<section>";
17
18         if (!PConfig::get($profile_uid, "system", "no_auto_update") || ($_GET["force"] == 1)) {
19                 $text = network_content($a, $profile_uid);
20         } else {
21                 $text = "";
22         }
23
24         $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
25         $replace = "<img\${1} dst=\"\${2}\"";
26         $text = preg_replace($pattern, $replace, $text);
27
28         if (PConfig::get(local_user(), "system", "bandwith_saver")) {
29                 $replace = "<br />" . t("[Embedded content - reload page to view]") . "<br />";
30                 $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
31                 $text = preg_replace($pattern, $replace, $text);
32                 $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
33                 $text = preg_replace($pattern, $replace, $text);
34                 $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
35                 $text = preg_replace($pattern, $replace, $text);
36                 $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
37                 $text = preg_replace($pattern, $replace, $text);
38         }
39
40         echo str_replace("\t", "       ", $text);
41         echo "</section>";
42         echo "</body></html>\r\n";
43         killme();
44 }