Skip to content

Commit

Permalink
Inverted check for date validity.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricebg committed Aug 25, 2022
1 parent 54bb986 commit 149653c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/publications/class-db-publications.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ public static function add_publication($data, $tags, $bookmark = array() ) {
'editor' => stripslashes($data['editor']),
'isbn' => $data['isbn'],
'url' => $data['url'],
'date' => preg_match('/\d\d\d\d-\d\d-\d\d/', $data['date']) === 1 ? '0000-00-00' : $data['date'],
'urldate' => preg_match('/\d\d\d\d-\d\d-\d\d/', $data['urldate']) === 1 ? '0000-00-00' : $data['urldate'],
'date' => preg_match('/\d\d\d\d-\d\d-\d\d/', $data['date']) === 1 ? $data['date'] : '0000-00-00',
'urldate' => preg_match('/\d\d\d\d-\d\d-\d\d/', $data['urldate']) === 1 ? $data['urldate'] : '0000-00-00',
'booktitle' => stripslashes($data['booktitle']),
'issuetitle' => stripslashes($data['issuetitle']),
'journal' => stripslashes($data['journal']),
Expand Down

0 comments on commit 149653c

Please sign in to comment.