From 0b5d58794e90ef7c924a2177a3b2f37132f6d8e6 Mon Sep 17 00:00:00 2001 From: Stephane Chapron <schapron@centreon.com> Date: Mon, 16 Apr 2018 10:56:48 +0200 Subject: [PATCH] Fix(license) : Filename cannot be empty --- src/CentreonLegacy/Core/Module/License.php | 6 +++--- www/include/options/oreon/modules/listModules.ihtml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CentreonLegacy/Core/Module/License.php b/src/CentreonLegacy/Core/Module/License.php index 9ac8617fb3..7597d642c8 100644 --- a/src/CentreonLegacy/Core/Module/License.php +++ b/src/CentreonLegacy/Core/Module/License.php @@ -57,11 +57,11 @@ class License extends Module * * @return array */ - private function parseLicenseFile() + private function parseLicenseFile($licenseFile) { $info = array(); - $lines = preg_split('/\n/', file_get_contents($this->licenseFile)); + $lines = preg_split('/\n/', file_get_contents($licenseFile)); foreach ($lines as $line) { if (preg_match('/^([^= ]+)\s*=\s*(.+)$/', $line, $match)) { $info[$match[1]] = $match[2]; @@ -84,7 +84,7 @@ class License extends Module } else { $zend_info = $this->parseLicenseFile($licenseFile); } - $licenseExpiration = date("d/m/Y", strtotime($zend_info['Expires'])); + $licenseExpiration = strtotime($zend_info['Expires']); } else { $licenseExpiration = _("N/A"); } diff --git a/www/include/options/oreon/modules/listModules.ihtml b/www/include/options/oreon/modules/listModules.ihtml index ae7bf08ae2..57db5de044 100644 --- a/www/include/options/oreon/modules/listModules.ihtml +++ b/www/include/options/oreon/modules/listModules.ihtml @@ -23,7 +23,7 @@ <td class="ListColCenter">{$properties.installed_version}</td> <td class="ListColCenter">{$properties.author}</td> <!-- using a class to format the timestamp --> - <td class="ListColCenter isTimestamp">{$properties.license_expiration}</td> + <td class="ListColCenter isTimestamp isDate">{$properties.license_expiration}</td> <td class="ListColCenter">{$properties.installed}</td> <td id="{$properties.name}" class="ListColCenter"></td> <td id="action_{$properties.name}" class="ListColRight"> -- GitLab