Merge pull request #1707 from FHenry/3.6

avoid warning message on preg_replace
$dateSelector is a paramters of formAddObjectLine, if use global it is
reset to 0 because not declare in outer context but already exists in
the same context.