Merge pull request #987 from Arantor/release-2.1

! Convert a use of fopen/fwrite/fclose to file_put_contents (Mantis 4913...
Merge pull request #989 from Arantor/release-2.1

Some minor cleanup
Merge pull request #991 from Arantor/release-2.1

! Fields that are regex-validated can't be left empty as per http://www....
Merge pull request #993 from Arantor/release-2.1

Minor things