Fixed XenForo_Model_User::updateSessionActivity wrong "substr" function use

d.kavelin

Member
Affected version
1.x
PHP:
public function updateSessionActivity($userId, $ip, $controllerName, $action, $viewState, array $inputParams, $viewDate = null, $robotKey = '')
{
    ...
    $controllerName = substr($controllerName, 0, 50); // why 50? In database table "xf_session_activity"column "controller_name" has type varbinary(75)
    $action = substr($action, 0, 50);
    ...
    try
    {
            $this->_getDb()->query('
                INSERT INTO xf_session_activity
                    (user_id, unique_key, ip, controller_name, controller_action, view_state, params, view_date, robot_key)
                VALUES
                    (?, ?, ?, ?, ?, ?, ?, ?, ?)
    ...

}
 
Back
Top Bottom