-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14458 from Elgg/5.x
upmerge 5.x into master
- Loading branch information
Showing
352 changed files
with
5,940 additions
and
4,567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* Save the configuration of the security.txt contents | ||
*/ | ||
|
||
$fields = [ | ||
'contact' => true, | ||
'expires' => true, | ||
'encryption' => false, | ||
'acknowledgments' => false, | ||
'language' => false, | ||
'canonical' => false, | ||
'policy' => false, | ||
'hiring' => false, | ||
'csaf' => false, | ||
]; | ||
|
||
// first validate all required inputs | ||
foreach ($fields as $name => $required) { | ||
$value = get_input($name); | ||
if (!$required || !empty($value)) { | ||
continue; | ||
} | ||
|
||
return elgg_error_response(elgg_echo('error:missing_data')); | ||
} | ||
|
||
// save all data | ||
foreach ($fields as $name => $required) { | ||
elgg_save_config("security_txt_{$name}", get_input($name) ?: null); | ||
} | ||
|
||
return elgg_ok_response('', elgg_echo('save:success')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.