Move multiple functions

move multiple smaller functions
This commit is contained in:
Adam Magness 2018-01-26 23:51:41 -05:00
commit 1eb7c19c1e
11 changed files with 24 additions and 56 deletions

View file

@ -332,20 +332,20 @@ function dfrn_request_post(App $a)
intval($contact_record['id'])
);
} else {
$url = validate_url($url);
$url = Network::validateURL($url);
if (!$url) {
notice(L10n::t('Invalid profile URL.') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd);
return; // NOTREACHED
}
if (!allowed_url($url)) {
if (!Network::allowedURL($url)) {
notice(L10n::t('Disallowed profile URL.') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd);
return; // NOTREACHED
}
if (blocked_url($url)) {
if (Network::blockedURL($url)) {
notice(L10n::t('Blocked domain') . EOL);
goaway(System::baseUrl() . '/' . $a->cmd);
return; // NOTREACHED

View file

@ -46,7 +46,7 @@ function dirfind_content(App $a, $prefix = "") {
if (strpos($search,'@') === 0) {
$search = substr($search,1);
$header = L10n::t('People Search - %s', $search);
if ((valid_email($search) && validate_email($search)) ||
if ((valid_email($search) && Network::validateEmail($search)) ||
(substr(normalise_link($search), 0, 7) == "http://")) {
$user_data = Probe::uri($search);
$discover_user = (in_array($user_data["network"], [NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_DIASPORA]));

View file

@ -17,6 +17,7 @@ use Friendica\Model\GContact;
use Friendica\Model\Group;
use Friendica\Model\User;
use Friendica\Protocol\Email;
use Friendica\Util\Network;
function get_theme_config_file($theme)
{
@ -535,7 +536,7 @@ function settings_post(App $a)
// If openid has changed or if there's an openid but no openidserver, try and discover it.
if ($openid != $a->user['openid'] || (strlen($openid) && (!strlen($openidserver)))) {
if (validate_url($openid)) {
if (Network::validateURL($openid)) {
logger('updating openidserver');
require_once 'library/openid.php';
$open_id_obj = new LightOpenID;