Validate license before adding it

This commit is contained in:
Djamil Legato
2016-09-27 11:51:46 -07:00
parent 0cc01d3355
commit 274fef2112

View File

@@ -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]);