Fix count() warning in Model\Profile

- Replace x() calls with empty() in Profile::load
- Remove extraneous $a->page['aside'] initialization
This commit is contained in:
Hypolite Petovan 2018-04-23 00:01:46 -04:00
parent da4892b4d2
commit b0564ea40d
1 changed files with 2 additions and 6 deletions

View File

@ -92,14 +92,14 @@ class Profile
{ {
$user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname]); $user = dba::selectFirst('user', ['uid'], ['nickname' => $nickname]);
if (!$user && !count($user) && !count($profiledata)) { if (!DBM::is_result($user) && empty($profiledata)) {
logger('profile error: ' . $a->query_string, LOGGER_DEBUG); logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
notice(L10n::t('Requested account is not available.') . EOL); notice(L10n::t('Requested account is not available.') . EOL);
$a->error = 404; $a->error = 404;
return; return;
} }
if (!x($a->page, 'aside')) { if (empty($a->page['aside'])) {
$a->page['aside'] = ''; $a->page['aside'] = '';
} }
@ -157,10 +157,6 @@ class Profile
require_once $theme_info_file; require_once $theme_info_file;
} }
if (!x($a->page, 'aside')) {
$a->page['aside'] = '';
}
if (local_user() && local_user() == $a->profile['uid'] && $profiledata) { if (local_user() && local_user() == $a->profile['uid'] && $profiledata) {
$a->page['aside'] .= replace_macros( $a->page['aside'] .= replace_macros(
get_markup_template('profile_edlink.tpl'), get_markup_template('profile_edlink.tpl'),