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.
 
 
 
 
 
 

49 lines
1.3 KiB

  1. <?php
  2. /**
  3. * @file mod/update_network
  4. * See update_profile.php for documentation
  5. */
  6. use Friendica\App;
  7. use Friendica\Core\L10n;
  8. use Friendica\DI;
  9. require_once "mod/network.php";
  10. function update_network_content(App $a)
  11. {
  12. if (!isset($_GET['p']) || !isset($_GET['item'])) {
  13. exit();
  14. }
  15. $profile_uid = intval($_GET['p']);
  16. $parent = intval($_GET['item']);
  17. header("Content-type: text/html");
  18. echo "<!DOCTYPE html><html><body>\r\n";
  19. echo "<section>";
  20. if (!DI::pConfig()->get($profile_uid, "system", "no_auto_update") || ($_GET["force"] == 1)) {
  21. $text = network_content($a, $profile_uid, $parent);
  22. } else {
  23. $text = "";
  24. }
  25. if (DI::pConfig()->get(local_user(), "system", "bandwidth_saver")) {
  26. $replace = "<br />" . L10n::t("[Embedded content - reload page to view]") . "<br />";
  27. $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i";
  28. $text = preg_replace($pattern, $replace, $text);
  29. $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i";
  30. $text = preg_replace($pattern, $replace, $text);
  31. $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i";
  32. $text = preg_replace($pattern, $replace, $text);
  33. $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i";
  34. $text = preg_replace($pattern, $replace, $text);
  35. }
  36. echo str_replace("\t", " ", $text);
  37. echo "</section>";
  38. echo "</body></html>\r\n";
  39. exit();
  40. }