Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

11 years ago
11 years ago
  1. <?php
  2. // See update_profile.php for documentation
  3. require_once("mod/network.php");
  4. require_once("include/group.php");
  5. function update_network_content(App $a) {
  6. $profile_uid = intval($_GET["p"]);
  7. header("Content-type: text/html");
  8. echo "<!DOCTYPE html><html><body>\r\n";
  9. echo "<section>";
  10. if (!get_pconfig($profile_uid, "system", "no_auto_update") OR ($_GET["force"] == 1)) {
  11. $text = network_content($a, $profile_uid);
  12. } else {
  13. $text = "";
  14. }
  15. $pattern = "/<img([^>]*) src=\"([^\"]*)\"/";
  16. $replace = "<img\${1} dst=\"\${2}\"";
  17. $text = preg_replace($pattern, $replace, $text);
  18. if (get_pconfig(local_user(), "system", "bandwith_saver")) {
  19. $replace = "<br />".t("[Embedded content - reload page to view]")."<br />";
  20. $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
  21. $text = preg_replace($pattern, $replace, $text);
  22. $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
  23. $text = preg_replace($pattern, $replace, $text);
  24. $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
  25. $text = preg_replace($pattern, $replace, $text);
  26. $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
  27. $text = preg_replace($pattern, $replace, $text);
  28. }
  29. echo str_replace("\t", " ", $text);
  30. echo "</section>";
  31. echo "</body></html>\r\n";
  32. killme();
  33. }