Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion inc/userinjection.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ public function connectedTo()

public function isNullable($field)
{
return true; // By default, all fields can be null
return in_array($field, [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the user, that's a long list. Wouldn't it be easier to manage an exclusion list?

In any case, it needs to be sorted alphabetically, which will make it easier to maintain.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your example only has 15 columns, so you can easily display everything on one screen without scrolling, which is not the case here.

For consistency, you can reorder the other case as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After running a few tests, only these fields need to be added to the list. The others do not return any errors, so I don't think it's necessary to add them.

public function isNullable($field)
    {
        return in_array($field, [
            'begin_date',
            'date_sync',
            'end_date',
            'last_login',
            'substitution_end_date',
            'substitution_start_date',
        ]);
    }

'begin_date',
'date_sync',
'end_date',
'last_login',
'substitution_end_date',
'substitution_start_date',
]);
}


Expand Down