3 * @file mod/update_network
4 * See update_profile.php for documentation
8 use Friendica\Core\L10n;
9 use Friendica\Core\PConfig;
11 require_once "mod/network.php";
13 function update_network_content(App $a)
15 $profile_uid = intval($_GET["p"]);
17 header("Content-type: text/html");
18 echo "<!DOCTYPE html><html><body>\r\n";
21 if (!PConfig::get($profile_uid, "system", "no_auto_update") || ($_GET["force"] == 1)) {
22 $text = network_content($a, $profile_uid);
27 $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
28 $replace = "<img\${1} dst=\"\${2}\"";
29 $text = preg_replace($pattern, $replace, $text);
31 if (PConfig::get(local_user(), "system", "bandwith_saver")) {
32 $replace = "<br />" . 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);
43 echo str_replace("\t", " ", $text);
45 echo "</body></html>\r\n";