mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #3838 from gschlager/phpbb3-importer-patch2
FIX: phpBB3 importer should ignore invalid birthdates
This commit is contained in:
commit
0696cf5f48
@ -68,7 +68,8 @@ module ImportScripts::PhpBB3
|
|||||||
|
|
||||||
def parse_birthdate(row)
|
def parse_birthdate(row)
|
||||||
return nil if row[:user_birthday].blank?
|
return nil if row[:user_birthday].blank?
|
||||||
Date.strptime(row[:user_birthday].delete(' '), '%d-%m-%Y') rescue nil
|
birthdate = Date.strptime(row[:user_birthday].delete(' '), '%d-%m-%Y') rescue nil
|
||||||
|
birthdate && birthdate.year > 0 ? birthdate : nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# Suspends the user if it is currently banned.
|
# Suspends the user if it is currently banned.
|
||||||
|
Loading…
Reference in New Issue
Block a user