From 0f1be372797c3911323c15b85a82ea47db0608f8 Mon Sep 17 00:00:00 2001 From: Adam Magness <adam.magness@gmail.com> Date: Sat, 27 Jan 2018 08:28:20 -0500 Subject: [PATCH] Remove old file remove network.php and all require_once statements --- boot.php | 1 - include/bbcode.php | 4 --- include/network.php | 58 -------------------------------- src/Content/Text/BBCode.php | 1 - src/Model/GContact.php | 1 - src/Model/User.php | 1 - src/Network/Probe.php | 2 +- src/Protocol/PortableContact.php | 1 - src/Util/ParseUrl.php | 1 - 9 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 include/network.php diff --git a/boot.php b/boot.php index ede6fc77b9..98db95227f 100644 --- a/boot.php +++ b/boot.php @@ -32,7 +32,6 @@ use Friendica\Model\Contact; use Friendica\Database\DBStructure; use Friendica\Module\Login; -require_once 'include/network.php'; require_once 'include/text.php'; require_once 'include/datetime.php'; diff --git a/include/bbcode.php b/include/bbcode.php index 0544c4c616..8f758ae616 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -748,8 +748,6 @@ function bb_RemovePictureLinks($match) { $text = "[url=".$match[2]."]".$match[2]."[/url]"; // if its not a picture then look if its a page that contains a picture link - require_once("include/network.php"); - $body = Network::fetchURL($match[1]); $doc = new DOMDocument(); @@ -805,8 +803,6 @@ function bb_CleanPictureLinksSub($match) { $text = "[img]".$match[2]."[/img]"; // if its not a picture then look if its a page that contains a picture link - require_once("include/network.php"); - $body = Network::fetchURL($match[1]); $doc = new DOMDocument(); diff --git a/include/network.php b/include/network.php deleted file mode 100644 index 840991aa52..0000000000 --- a/include/network.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * @file include/network.php - */ -use Friendica\App; -use Friendica\Core\Addon; -use Friendica\Core\L10n; -use Friendica\Core\System; -use Friendica\Core\Config; -use Friendica\Network\Probe; -use Friendica\Object\Image; -use Friendica\Util\Network; -use Friendica\Util\XML; - -function parse_xml_string($s, $strict = true) -{ - return Network::parseXmlString($s, $strict); -} - -function scale_external_images($srctext, $include_link = true, $scale_replace = false) -{ - return Network::scaleExternalImages($srctext, $include_link, $scale_replace); -} - -function fix_contact_ssl_policy(&$contact, $new_policy) -{ - Network::fixContactSslPolicy($contact, $new_policy); -} - -function strip_tracking_query_params($url) -{ - return Network::stripTrackingQueryParams($url); -} - -function original_url($url, $depth = 1, $fetchbody = false) -{ - return Network::originalURL($url, $depth, $fetchbody); -} - -function short_link($url) -{ - return Network::shortLink($url); -} - -function json_return_and_die($x) -{ - Network::jsonReturnAndDie($x); -} - -function matching_url($url1, $url2) -{ - return Network::matchingURL($url1, $url2); -} - -function unParseUrl($parsed) -{ - return Network::unParseURL($parsed); -} diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 9162316d72..664be933ae 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -12,7 +12,6 @@ use Friendica\Util\ParseUrl; require_once "include/bbcode.php"; require_once "include/html2plain.php"; -require_once "include/network.php"; class BBCode { diff --git a/src/Model/GContact.php b/src/Model/GContact.php index 231970820f..0991110316 100644 --- a/src/Model/GContact.php +++ b/src/Model/GContact.php @@ -19,7 +19,6 @@ use Exception; require_once 'include/datetime.php'; require_once 'include/dba.php'; -require_once 'include/network.php'; require_once 'include/html2bbcode.php'; /** diff --git a/src/Model/User.php b/src/Model/User.php index bc14098d40..c767ec1b62 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -24,7 +24,6 @@ use Exception; require_once 'boot.php'; require_once 'include/dba.php'; require_once 'include/enotify.php'; -require_once 'include/network.php'; require_once 'library/openid.php'; require_once 'include/text.php'; /** diff --git a/src/Network/Probe.php b/src/Network/Probe.php index db4f307b6b..79b3840034 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -209,7 +209,7 @@ class Probe /** * @brief Check an URI for LRDD data * - * this is a replacement for the "lrdd" function in include/network.php. + * this is a replacement for the "lrdd" function. * It isn't used in this class and has some redundancies in the code. * When time comes we can check the existing calls for "lrdd" if we can rework them. * diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index 35ec7fe962..9ed48b1cf4 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -23,7 +23,6 @@ use Exception; require_once 'include/dba.php'; require_once 'include/datetime.php'; -require_once 'include/network.php'; require_once 'include/html2bbcode.php'; class PortableContact diff --git a/src/Util/ParseUrl.php b/src/Util/ParseUrl.php index ba9b7ec146..1c5676aced 100644 --- a/src/Util/ParseUrl.php +++ b/src/Util/ParseUrl.php @@ -16,7 +16,6 @@ use DOMXPath; use DOMDocument; require_once 'include/dba.php'; -require_once "include/network.php"; /** * @brief Class with methods for extracting certain content from an url -- 2.39.5