1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/14972] replace all occurrences of sizeof() with the count()

PHPBB3-14972
This commit is contained in:
rxu
2017-06-28 00:58:03 +07:00
parent 67a65e3788
commit 797234e416
165 changed files with 986 additions and 986 deletions

View File

@@ -98,7 +98,7 @@ class ucp_profile
$passwords_manager = $phpbb_container->get('passwords.manager');
// Only check the new password against the previous password if there have been no errors
if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && $passwords_manager->check($data['new_password'], $user->data['user_password']))
if (!count($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && $passwords_manager->check($data['new_password'], $user->data['user_password']))
{
$error[] = 'SAME_PASSWORD_ERROR';
}
@@ -125,7 +125,7 @@ class ucp_profile
$vars = array('data', 'submit', 'error');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_validate', compact($vars)));
if (!sizeof($error))
if (!count($error))
{
$sql_ary = array(
'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $data['username'] : $user->data['username'],
@@ -220,7 +220,7 @@ class ucp_profile
$vars = array('data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_sql_ary', compact($vars)));
if (sizeof($sql_ary))
if (count($sql_ary))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
@@ -257,7 +257,7 @@ class ucp_profile
}
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'ERROR' => (count($error)) ? implode('<br />', $error) : '',
'USERNAME' => $data['username'],
'EMAIL' => $data['email'],
@@ -343,7 +343,7 @@ class ucp_profile
// validate custom profile fields
$cp->submit_cp_field('profile', $user->get_iso_lang_id(), $cp_data, $cp_error);
if (sizeof($cp_error))
if (count($cp_error))
{
$error = array_merge($error, $cp_error);
}
@@ -365,7 +365,7 @@ class ucp_profile
$vars = array('data', 'submit', 'error');
extract($phpbb_dispatcher->trigger_event('core.ucp_profile_validate_profile_info', compact($vars)));
if (!sizeof($error))
if (!count($error))
{
$data['notify'] = $user->data['user_notify_type'];
@@ -449,7 +449,7 @@ class ucp_profile
}
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'ERROR' => (count($error)) ? implode('<br />', $error) : '',
'S_JABBER_ENABLED' => $config['jab_enable'],
'JABBER' => $data['jabber'],
));
@@ -537,7 +537,7 @@ class ucp_profile
'sig'
);
if (sizeof($warn_msg))
if (count($warn_msg))
{
$error += $warn_msg;
}
@@ -549,7 +549,7 @@ class ucp_profile
}
else
{
if (!sizeof($error))
if (!count($error))
{
$user->optionset('sig_bbcode', $enable_bbcode);
$user->optionset('sig_smilies', $enable_smilies);
@@ -594,7 +594,7 @@ class ucp_profile
$controller_helper = $phpbb_container->get('controller.helper');
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'ERROR' => (count($error)) ? implode('<br />', $error) : '',
'SIGNATURE' => $decoded_message['text'],
'SIGNATURE_PREVIEW' => $signature_preview,
@@ -753,7 +753,7 @@ class ucp_profile
$avatar = phpbb_get_user_avatar($user->data, 'USER_AVATAR', true);
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'ERROR' => (count($error)) ? implode('<br />', $error) : '',
'AVATAR' => $avatar,
'S_FORM_ENCTYPE' => ' enctype="multipart/form-data"',
@@ -778,7 +778,7 @@ class ucp_profile
$error[] = 'FORM_INVALID';
}
if (!sizeof($error))
if (!count($error))
{
if (!empty($keys))
{
@@ -825,7 +825,7 @@ class ucp_profile
}
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'ERROR' => (count($error)) ? implode('<br />', $error) : '',
'L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)],