diff options
| author | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
|---|---|---|
| committer | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
| commit | 4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch) | |
| tree | 5c07151ae61276d334e88f6309c30d439a85c12e /lib/classes/DataFieldEmailEntry.php | |
| parent | da0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff) | |
| parent | 97a188592c679890a25c37ab78463add76a52ff7 (diff) | |
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'lib/classes/DataFieldEmailEntry.php')
| -rw-r--r-- | lib/classes/DataFieldEmailEntry.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/classes/DataFieldEmailEntry.php b/lib/classes/DataFieldEmailEntry.php new file mode 100644 index 0000000..aafe7bb --- /dev/null +++ b/lib/classes/DataFieldEmailEntry.php @@ -0,0 +1,25 @@ +<?php +# Lifter002: DONE +# Lifter007: TEST + +/** + * @author Jan-Hendrik Willms <tleilax+studip@gmail.com> + * @author Marcus Lunzenauer <mlunzena@uos.de> + * @author Martin Gieseking <mgieseki@uos.de> + * @license GPL2 or any later version + */ +class DataFieldEmailEntry extends DataFieldEntry +{ + protected $template = 'email.php'; + + /** + * Returns whether the datafield contents are valid + * + * @return boolean indicating whether the datafield contents are valid + */ + public function isValid() + { + return parent::isValid() + && (!$this->getValue() || filter_var($this->getValue(), FILTER_VALIDATE_EMAIL)); + } +} |
