Browse Source

Check for license validity only on newly updated branches, refs composer/packagist#866, refs composer/packagist#883

Jordi Boggiano 7 years ago
parent
commit
72476b62d4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/Composer/Package/Loader/ValidatingArrayLoader.php

+ 2 - 1
src/Composer/Package/Loader/ValidatingArrayLoader.php

@@ -103,7 +103,8 @@ class ValidatingArrayLoader implements LoaderInterface
             }
         }
 
-        if (isset($this->config['license'])) {
+        // check for license validity on newly updated branches
+        if (isset($this->config['license']) && (!$releaseDate || $releaseDate->getTimestamp() >= strtotime('-8days'))) {
             if (is_array($this->config['license']) || is_string($this->config['license'])) {
                 $licenses = (array) $this->config['license'];