X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fupdate_network.php;h=a6c8173794546301ed8af159d42cd9bd37e9a868;hb=a5e91175243a41c77a56e73efc3672f20a7e6d23;hp=f8dd8ccc49d5da08ee5ae338581b2865837fc595;hpb=08a30bc1c6c68d81895e0d8c8905680c7d26221f;p=friendica.git diff --git a/mod/update_network.php b/mod/update_network.php index f8dd8ccc49..a6c8173794 100644 --- a/mod/update_network.php +++ b/mod/update_network.php @@ -2,42 +2,44 @@ // See update_profile.php for documentation -require_once 'mod/network.php'; -require_once 'include/group.php'; - -function update_network_content(&$a) -{ - $profile_uid = intval($_GET['p']); - - header('Content-type: text/html'); - echo "\r\n"; - echo '
'; - - if (!get_pconfig($profile_uid, 'system', 'no_auto_update') or ($_GET['force'] == 1)) { - $text = network_content($a, $profile_uid); - } else { - $text = ''; - } - - $pattern = '/]*) src="([^"]*)"/'; - $replace = ''; - $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i"; - $text = preg_replace($pattern, $replace, $text); - $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i"; - $text = preg_replace($pattern, $replace, $text); - $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i"; - $text = preg_replace($pattern, $replace, $text); - $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i"; - $text = preg_replace($pattern, $replace, $text); - } - - // reportedly some versions of MSIE don't handle tabs in XMLHttpRequest documents very well - echo str_replace("\t", ' ', $text); - echo '
'; - echo "\r\n"; - killme(); +use Friendica\App; +use Friendica\Core\PConfig; + +require_once("mod/network.php"); +require_once("include/group.php"); + +function update_network_content(App $a) { + + $profile_uid = intval($_GET["p"]); + + header("Content-type: text/html"); + echo "\r\n"; + echo "
"; + + if (!PConfig::get($profile_uid, "system", "no_auto_update") || ($_GET["force"] == 1)) { + $text = network_content($a, $profile_uid); + } else { + $text = ""; + } + + $pattern = "/]*) src=\"([^\"]*)\"/"; + $replace = ""; + $pattern = "/<\s*audio[^>]*>(.*?)<\s*\/\s*audio>/i"; + $text = preg_replace($pattern, $replace, $text); + $pattern = "/<\s*video[^>]*>(.*?)<\s*\/\s*video>/i"; + $text = preg_replace($pattern, $replace, $text); + $pattern = "/<\s*embed[^>]*>(.*?)<\s*\/\s*embed>/i"; + $text = preg_replace($pattern, $replace, $text); + $pattern = "/<\s*iframe[^>]*>(.*?)<\s*\/\s*iframe>/i"; + $text = preg_replace($pattern, $replace, $text); + } + + echo str_replace("\t", " ", $text); + echo "
"; + echo "\r\n"; + killme(); }