Skip to content

Commit 1466c4a

Browse files
authored
Fix injection of not null fields (#542)
* add nullable fields on function * fix isNullable list * update CHANGELOG.md
1 parent 160d96d commit 1466c4a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Fixed
1111

12+
- Fix user fields nullability to prevent SQL errors during injection
1213
- Remove groups as import link field
1314
- Fix `clean` function
1415

inc/userinjection.class.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,14 @@ public function connectedTo()
5555

5656
public function isNullable($field)
5757
{
58-
return true; // By default, all fields can be null
58+
return in_array($field, [
59+
'begin_date',
60+
'date_sync',
61+
'end_date',
62+
'last_login',
63+
'substitution_end_date',
64+
'substitution_start_date',
65+
]);
5966
}
6067

6168

0 commit comments

Comments
 (0)