Explorar o código

Only update readme if there is actual content

Jordi Boggiano %!s(int64=8) %!d(string=hai) anos
pai
achega
9446640eba
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/Packagist/WebBundle/Package/Updater.php

+ 3 - 1
src/Packagist/WebBundle/Package/Updater.php

@@ -485,7 +485,9 @@ class Updater
             switch ($ext) {
                 case '.txt':
                     $source = $driver->getFileContent($readmeFile, $driver->getRootIdentifier());
-                    $package->setReadme('<pre>' . htmlspecialchars($source) . '</pre>');
+                    if (!empty($source)) {
+                        $package->setReadme('<pre>' . htmlspecialchars($source) . '</pre>');
+                    }
                     break;
 
                 case '.md':