3 // See update_profile.php for documentation
6 use Friendica\Core\PConfig;
8 require_once("mod/network.php");
9 require_once("include/group.php");
11 function update_network_content(App $a) {
13 $profile_uid = intval($_GET["p"]);
15 header("Content-type: text/html");
16 echo "<!DOCTYPE html><html><body>\r\n";
19 if (!PConfig::get($profile_uid, "system", "no_auto_update") || ($_GET["force"] == 1)) {
20 $text = network_content($a, $profile_uid);
25 $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
26 $replace = "<img\${1} dst=\"\${2}\"";
27 $text = preg_replace($pattern, $replace, $text);
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);
41 echo str_replace("\t", " ", $text);
43 echo "</body></html>\r\n";