]> git.mxchange.org Git - friendica.git/blob - mod/update_community.php
f0e96af48c1a519167eeb27c5e8ea7dd683cc18e
[friendica.git] / mod / update_community.php
1 <?php
2
3 // See update_profile.php for documentation
4
5 use Friendica\App;
6
7 require_once("mod/community.php");
8
9 function update_community_content(App $a) {
10
11         header("Content-type: text/html");
12         echo "<!DOCTYPE html><html><body>\r\n";
13         echo "<section>";
14
15         $text = community_content($a, true);
16         $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
17         $replace = "<img\${1} dst=\"\${2}\"";
18         $text = preg_replace($pattern, $replace, $text);
19
20         if (get_pconfig(local_user(), "system", "bandwith_saver")) {
21                 $replace = "<br />".t("[Embedded content - reload page to view]")."<br />";
22                 $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
23                 $text = preg_replace($pattern, $replace, $text);
24                 $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
25                 $text = preg_replace($pattern, $replace, $text);
26                 $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
27                 $text = preg_replace($pattern, $replace, $text);
28                 $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
29                 $text = preg_replace($pattern, $replace, $text);
30         }
31
32         echo str_replace("\t", "       ", $text);
33         echo "</section>";
34         echo "</body></html>\r\n";
35         killme();
36 }