mirror of
https://github.com/getgrav/grav.git
synced 2026-03-05 03:51:50 +01:00
Validate license before adding it
This commit is contained in:
@@ -39,6 +39,10 @@ class Licenses
|
||||
$licenses = YamlFile::instance(self::getLicensePath());
|
||||
$data = $licenses->content();
|
||||
|
||||
if ($license && !self::validate($license)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_string($license)) {
|
||||
if (isset($data['licenses'][$slug])) {
|
||||
unset($data['licenses'][$slug]);
|
||||
|
||||
Reference in New Issue
Block a user