Merge pull request #7646 from MrPetovan/bug/warnings

Remove setting obsolete App->data['user'] in Module\Profile\Contacts
This commit is contained in:
Philipp 2019-09-21 18:20:57 +02:00 committed by GitHub
commit 482cf1bbfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

@ -594,7 +594,7 @@ function profiles_content(App $a) {
'$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . L10n::t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""), '$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . L10n::t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
'$name' => ['name', L10n::t('Your Full Name:'), $r[0]['name']], '$name' => ['name', L10n::t('Your Full Name:'), $r[0]['name']],
'$pdesc' => ['pdesc', L10n::t('Title/Description:'), $r[0]['pdesc']], '$pdesc' => ['pdesc', L10n::t('Title/Description:'), $r[0]['pdesc']],
'$dob' => Temporal::getDateofBirthField($r[0]['dob']), '$dob' => Temporal::getDateofBirthField($r[0]['dob'], $a->user['timezone']),
'$hide_friends' => $hide_friends, '$hide_friends' => $hide_friends,
'$address' => ['address', L10n::t('Street Address:'), $r[0]['address']], '$address' => ['address', L10n::t('Street Address:'), $r[0]['address']],
'$locality' => ['locality', L10n::t('Locality/City:'), $r[0]['locality']], '$locality' => ['locality', L10n::t('Locality/City:'), $r[0]['locality']],

View File

@ -36,7 +36,6 @@ class Contacts extends BaseModule
throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('User not found.')); throw new \Friendica\Network\HTTPException\NotFoundException(L10n::t('User not found.'));
} }
$a->data['user'] = $user;
$a->profile_uid = $user['uid']; $a->profile_uid = $user['uid'];
Profile::load($a, $nickname); Profile::load($a, $nickname);

View File

@ -122,13 +122,12 @@ class Temporal
* @brief Wrapper for date selector, tailored for use in birthday fields. * @brief Wrapper for date selector, tailored for use in birthday fields.
* *
* @param string $dob Date of Birth * @param string $dob Date of Birth
* @param string $timezone
* @return string Formatted HTML * @return string Formatted HTML
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Exception
*/ */
public static function getDateofBirthField($dob) public static function getDateofBirthField(string $dob, string $timezone = 'UTC')
{ {
$a = \get_app();
list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d'); list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d');
if ($dob < '0000-01-01') { if ($dob < '0000-01-01') {
@ -137,7 +136,7 @@ class Temporal
$value = DateTimeFormat::utc(($year > 1000) ? $dob : '1000-' . $month . '-' . $day, 'Y-m-d'); $value = DateTimeFormat::utc(($year > 1000) ? $dob : '1000-' . $month . '-' . $day, 'Y-m-d');
} }
$age = (intval($value) ? self::getAgeByTimezone($value, $a->user["timezone"], $a->user["timezone"]) : ""); $age = (intval($value) ? self::getAgeByTimezone($value, $timezone, $timezone) : "");
$tpl = Renderer::getMarkupTemplate("field_input.tpl"); $tpl = Renderer::getMarkupTemplate("field_input.tpl");
$o = Renderer::replaceMacros($tpl, $o = Renderer::replaceMacros($tpl,