use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Core\Renderer;
-use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Profile;
use Friendica\Model\User;
-use Friendica\Module\Login;
+use Friendica\Module\Security\Login;
use Friendica\Network\Probe;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
);
if (! DBA::isResult($r)) {
notice(L10n::t('Profile not found.') . EOL);
- $a->internalRedirect('profiles');
+ DI::baseUrl()->redirect('profiles');
return; // NOTREACHED
}
info(L10n::t('Profile deleted.').EOL);
}
- $a->internalRedirect('profiles');
+ DI::baseUrl()->redirect('profiles');
return; // NOTREACHED
}
info(L10n::t('New profile created.') . EOL);
if (DBA::isResult($r3) && count($r3) == 1) {
- $a->internalRedirect('profiles/' . $r3[0]['id']);
+ DI::baseUrl()->redirect('profiles/' . $r3[0]['id']);
}
- $a->internalRedirect('profiles');
+ DI::baseUrl()->redirect('profiles');
}
if (($a->argc > 2) && ($a->argv[1] === 'clone')) {
);
info(L10n::t('New profile created.') . EOL);
if ((DBA::isResult($r3)) && (count($r3) == 1)) {
- $a->internalRedirect('profiles/'.$r3[0]['id']);
+ DI::baseUrl()->redirect('profiles/'.$r3[0]['id']);
}
- $a->internalRedirect('profiles');
+ DI::baseUrl()->redirect('profiles');
return; // NOTREACHED
}
return;
}
- $dob = $_POST['dob'] ? Strings::escapeHtml(trim($_POST['dob'])) : '0000-00-00';
+ $dob = !empty($_POST['dob']) ? Strings::escapeHtml(trim($_POST['dob'])) : '0000-00-00';
$y = substr($dob, 0, 4);
if ((! ctype_digit($y)) || ($y < 1900)) {
$namechanged = true;
}
- $pdesc = Strings::escapeTags(trim($_POST['pdesc']));
- $gender = Strings::escapeTags(trim($_POST['gender']));
- $address = Strings::escapeTags(trim($_POST['address']));
- $locality = Strings::escapeTags(trim($_POST['locality']));
- $region = Strings::escapeTags(trim($_POST['region']));
- $postal_code = Strings::escapeTags(trim($_POST['postal_code']));
- $country_name = Strings::escapeTags(trim($_POST['country_name']));
- $pub_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['pub_keywords'])));
- $prv_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['prv_keywords'])));
- $marital = Strings::escapeTags(trim($_POST['marital']));
- $howlong = Strings::escapeTags(trim($_POST['howlong']));
+ $pdesc = Strings::escapeTags(trim($_POST['pdesc'] ?? ''));
+ $gender = Strings::escapeTags(trim($_POST['gender'] ?? ''));
+ $address = Strings::escapeTags(trim($_POST['address'] ?? ''));
+ $locality = Strings::escapeTags(trim($_POST['locality'] ?? ''));
+ $region = Strings::escapeTags(trim($_POST['region'] ?? ''));
+ $postal_code = Strings::escapeTags(trim($_POST['postal_code'] ?? ''));
+ $country_name = Strings::escapeTags(trim($_POST['country_name'] ?? ''));
+ $pub_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['pub_keywords'] ?? '')));
+ $prv_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['prv_keywords'] ?? '')));
+ $marital = Strings::escapeTags(trim($_POST['marital'] ?? ''));
+ $howlong = Strings::escapeTags(trim($_POST['howlong'] ?? ''));
$with = (!empty($_POST['with']) ? Strings::escapeTags(trim($_POST['with'])) : '');
$hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
- PConfig::set(local_user(), 'system', 'detailled_profile', (($_POST['detailed_profile'] == 1) ? 1: 0));
+ PConfig::set(local_user(), 'system', 'detailled_profile', !empty($_POST['detailed_profile']) ? 1: 0);
$changes = [];
if ($is_default) {
return;
}
- $a->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('profed_head.tpl'), [
- '$baseurl' => System::baseUrl(true),
+ DI::page()['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('profed_head.tpl'), [
+ '$baseurl' => DI::baseUrl()->get(true),
]);
$opt_tpl = Renderer::getMarkupTemplate("profile-hide-friends.tpl");
'$lbl_ex2' => L10n::t('Example: fishing photography software'),
'$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
- '$baseurl' => System::baseUrl(true),
+ '$baseurl' => DI::baseUrl()->get(true),
'$profile_id' => $r[0]['id'],
'$profile_name' => ['profile_name', L10n::t('Profile Name:'), $r[0]['profile-name'], L10n::t('Required'), '*'],
'$is_default' => $is_default,
);
if (DBA::isResult($r)) {
//Go to the default profile.
- $a->internalRedirect('profiles/' . $r[0]['id']);
+ DI::baseUrl()->redirect('profiles/' . $r[0]['id']);
}
}
$profiles = '';
foreach ($r as $rr) {
$profiles .= Renderer::replaceMacros($tpl, [
- '$photo' => $a->removeBaseURL($rr['thumb']),
+ '$photo' => DI::baseUrl()->remove($rr['thumb']),
'$id' => $rr['id'],
'$alt' => L10n::t('Profile Image'),
'$profile_name' => $rr['profile-name'],