diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-10-24 11:57:33 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-11-07 10:50:42 +0100 |
commit | 7006b739b0d646bf55a65f339546d2e179508ece (patch) | |
tree | 892433fa484ddcc1ae1d24300fd0f2d7ab1d9a5b /build/license.php | |
parent | 44f9779f9f1b85110d2185ca4396d9b26ab85eec (diff) | |
download | nextcloud-server-7006b739b0d646bf55a65f339546d2e179508ece.tar.gz nextcloud-server-7006b739b0d646bf55a65f339546d2e179508ece.zip |
Remove brackets for invalid mail addresses when updating the license header
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'build/license.php')
-rw-r--r-- | build/license.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/build/license.php b/build/license.php index 3f1fe41764a..cb19f196fff 100644 --- a/build/license.php +++ b/build/license.php @@ -322,6 +322,7 @@ With help from many libraries and frameworks including: } $authors = array_map(function($author){ + $author = $this->fixInvalidEmail($author); $this->authors[$author] = $author; return " * @author $author"; }, $authors); @@ -348,6 +349,14 @@ With help from many libraries and frameworks including: } return $author; } + + private function fixInvalidEmail($author) { + preg_match('/<(.*)>/', $author, $mailMatch); + if (count($mailMatch) === 2 && !filter_var($mailMatch[1], FILTER_VALIDATE_EMAIL)) { + $author = str_replace('<'.$mailMatch[1].'>', '"'.$mailMatch[1].'"', $author); + } + return $author; + } } $licenses = new Licenses; |