usersettings.php
Consider simplifying this complex logical expression. Open
Open
if(!is_array($info) || ($info['user_admin'] == 1 && (!defined('ADMINPERMS') || ADMINPERMS !== '0')) || ((!defined('ADMINPERMS') || ADMINPERMS !== '0') && !getperms('4')))
{
e107::redirect();
exit();
}
Avoid deeply nested control flow statements. Open
Open
if ($nid != $udata['user_baseclasslist'])
{
if (US_DEBUG)
{
e107::getLog()->addEvent(10, debug_backtrace(), "DEBUG", "Usersettings test", "Write back classes; old list: {$udata['user_class']}; new list: ".$nid, false, LOG_TO_ROLLING);
Consider simplifying this complex logical expression. Open
Open
if ($upload['name'] && ($upload['index'] == 'avatar') && $pref['avatar_upload'])
{
// avatar uploaded - give it a reference which identifies it as server-stored
// Vetting routines will do resizing and so on
$_POST['image'] = '-upload-'.$upload['name'];
Avoid too many return
statements within this method. Open
Open
return false;
Returning type null
but init()
is declared to return bool
Open
Open
return null;
- Exclude checks
Argument 1 (var)
is ?array<string>|?array<string>|?array<string>|?array<string>|?array{user_email:mixed,user_password:,user_name:mixed}|?array{user_name:mixed}|?array{user_password:,user_name:mixed}|?array{}</string></string></string></string>
but \count()
takes \Countable|array
Open
Open
if (count($do_log) > 1) { $log_action = USER_AUDIT_NEW_SET; } // Log multiple entries to one record
- Exclude checks
Call to deprecated function \getperms()
defined at /code/class2.php:1322
Open
Open
if(!is_array($info) || ($info['user_admin'] == 1 && (!defined('ADMINPERMS') || ADMINPERMS !== '0')) || ((!defined('ADMINPERMS') || ADMINPERMS !== '0') && !getperms('4')))
- Exclude checks
Call to deprecated function \getperms()
defined at /code/class2.php:1322
Open
Open
if (ADMIN && getperms('4'))
- Exclude checks
Argument 1 (var)
is ?array|?array{_CHANGED_BY_UID:1}|?array{_CHANGED_BY_UNAME:'e107-cli'}|?array{ue:array|array{user_extended_id:int}|null}|?array{user_class:string}|?array{user_email:mixed,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_loginname:mixed}|?array{user_email:mixed,user_class:string,user_image:mixed,user_name:mixed,user_sess:''}|?array{user_email?:null,user_class:string,user_image:mixed,user_name:mixed,user_sess:''}|?array{user_id:array|mixed|string}|?array{user_image:mixed,user_name:mixed,user_sess:''}|?array{user_loginname:mixed,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_email:mixed}|?array{user_loginname:mixed,user_class:string,user_image:mixed,user_name:mixed,user_sess:''}|?array{user_loginname?:null,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_email:mixed}|?array{user_name:array|mixed|string}|?array{user_name:mixed}|?array{user_name?:null,user_loginname:mixed|null,user_class:string,user_image:mixed,user_sess:'',user_email:mixed|null,user_prefs:array|string,user_password?:null,user_id:array|mixed|string,_CHANGED_BY_UID:1,_CHANGED_BY_UNAME:'e107-cli'}|?array{user_password:,user_email:mixed|null,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_prefs:array|string,user_loginname:mixed|null}|?array{user_password:}|?array{user_password?:null,user_email:mixed|null,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_prefs:array|string,user_loginname:mixed|null}|?array{user_prefs:array|string}|?array{user_sess:''}|?array{}|?bool|?string
but \count()
takes \Countable|array
Open
Open
if (count($triggerData))
- Exclude checks
Call to deprecated function \getperms()
defined at /code/class2.php:1322
Open
Open
if (!(ADMIN && getperms('4')))
- Exclude checks
Argument 1 (var)
is ?array|?array{user_class:string,user_image:mixed,user_sess:'',user_prefs:array|string,user_loginname:mixed|null,user_name:null,user_password?:null}|?array{user_email?:null,user_class:string,user_image:mixed,user_sess:'',user_prefs:array|string,user_loginname:mixed|null,user_name:null,user_password?:null}|?bool|?string
but \count()
takes \Countable|array
Open
Open
if (count($changedUserData) && isset($user_logging_opts[USER_AUDIT_NEW_SET]))
- Exclude checks
Suspicious array access to nullable ?array|?array<string>|?array<string>|?array<string>|?array<string>|?bool|?string</string></string></string></string>
Open
Open
$curVal['user_class'] = varset($changedUserData['user_class'], $curVal['user_class']);
- Exclude checks
Variable $alldata
was undeclared, but array fields are being added to it. Open
Open
$alldata['errors']['user_loginname'] = ERR_GENERIC;
- Exclude checks
Argument 3 (uid)
is bool
but \check_class()
takes int
defined at /code/class2.php:1207
Open
Open
if (!check_class($pref['displayname_class'], $udata['user_classlist'], $adminEdit))
- Exclude checks
Call to undeclared method \e_db::escape
Open
Open
$changedUserData['user_password'] = $sql->escape($userMethods->HashPassword($savePassword, $loginname), false);
- Exclude checks
Variable $changedData
was undeclared, but array fields are being added to it. Open
Open
$changedData['data'] = $changedUserData;
- Exclude checks
Argument 2 (args)
is ?array|?array{user_class:string,user_image:mixed,user_sess:'',user_prefs:array|string,user_loginname:mixed|null,user_name:null,user_password?:null}|?array{user_email?:null,user_class:string,user_image:mixed,user_sess:'',user_prefs:array|string,user_loginname:mixed|null,user_name:null,user_password?:null}|?bool|?string
but \array_merge()
takes array
Open
Open
$do_log = array_merge($do_log, $changedUserData);
- Exclude checks
Argument 1 (ArrayData)
is ?array|?array<string>|?array<string>|?array<string>|?array<string>|?bool|?string</string></string></string></string>
but \e107::serialize()
takes array
defined at /code/e107_handlers/e107_class.php:2131
Open
Open
$updated_data = e107::serialize($changedUserData,'json');
- Exclude checks
Argument 1 (var)
is ?array<string>|?array<string>|?array<string>|?array<string>|?array{user_email:mixed,user_password:,user_name:mixed}|?array{user_name:mixed}|?array{user_password:,user_name:mixed}|?array{}</string></string></string></string>
but \count()
takes \Countable|array
Open
Open
if (count($do_log))
- Exclude checks
Call to undeclared method \e_shortcode::reset
Open
Open
e107::getScBatch('usersettings')->setVars($curVal)->reset();
- Exclude checks
Argument 1 (var)
is ?array|?array{user_class:string}|?array{user_email:mixed,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_loginname:mixed}|?array{user_email:mixed,user_class:string,user_image:mixed,user_name:mixed,user_sess:''}|?array{user_email?:null,user_class:string,user_image:mixed,user_name:mixed,user_sess:''}|?array{user_image:mixed,user_name:mixed,user_sess:''}|?array{user_loginname:mixed,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_email:mixed}|?array{user_loginname:mixed,user_class:string,user_image:mixed,user_name:mixed,user_sess:''}|?array{user_loginname?:null,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_email:mixed}|?array{user_name:mixed}|?array{user_password:,user_email:mixed|null,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_prefs:array|string,user_loginname:mixed|null}|?array{user_password:}|?array{user_password?:null,user_email:mixed|null,user_class:string,user_image:mixed,user_name:mixed,user_sess:'',user_prefs:array|string,user_loginname:mixed|null}|?array{user_prefs:array|string}|?array{user_sess:''}|?array{}|?bool|?string
but \count()
takes \Countable|array
Open
Open
if (count($changedUserData))
- Exclude checks
Argument 2 (value)
is 1
but \e_form::button()
takes array|string
defined at /code/e107_handlers/form_handler.php:3876
Open
Open
".e107::getForm()->button('SaveValidatedInfo',1, 'submit', LAN_ENTER)."
- Exclude checks
When fetching an array index from a value of type array<int>|array<int>|int|string,</int></int>
found an array index of type 'avatar',
but expected the index to be of type int
Open
Open
if (varset($_FILES['file_userfile']['error']['avatar'], false) === UPLOAD_ERR_OK || varset($_FILES['file_userfile']['error']['photo'], false) == UPLOAD_ERR_OK)
- Exclude checks
Suspicious array access to nullable ?array|?array{user_class:string}|?array{user_image:mixed,user_name:mixed,user_sess:''}|?array{user_name:mixed}|?array{user_sess:''}|?array{}|?bool|?string
Open
Open
$loginname = $changedUserData['user_loginname'] ? $changedUserData['user_loginname'] : $udata['user_loginname'];
- Exclude checks
When fetching an array index from a value of type array<int>|array<int>|int|string,</int></int>
found an array index of type 'photo',
but expected the index to be of type int
Open
Open
if (varset($_FILES['file_userfile']['error']['avatar'], false) === UPLOAD_ERR_OK || varset($_FILES['file_userfile']['error']['photo'], false) == UPLOAD_ERR_OK)
- Exclude checks
Call to deprecated function \getperms()
defined at /code/class2.php:1322
Open
Open
if ((!ADMIN || !getperms("4")) && e_QUERY && e_QUERY != "update" && substr(e_QUERY, 0, 4) !== 'del=')
- Exclude checks
Argument 1 (posted)
is false|string
but \UserHandler::hasReadonlyField()
takes array
defined at /code/e107_handlers/user_handler.php:192
Open
Open
if ($this->getValidationKey($new_data) !== $_POST['updated_key'] || ($userMethods->hasReadonlyField($new_data) !==false))
- Exclude checks