Aleksander Machniak
2016-03-14 126d099e8314eabb3f4e1dcb53b01e00f44916e8
Fix PHP warning when defaults.inc.php is not readable
1 files modified
18 ■■■■■ changed files
program/include/rcmail_install.php 18 ●●●●● patch | view | raw | blame | history
program/include/rcmail_install.php
@@ -574,21 +574,25 @@
    $plugins = array();
    $plugin_dir = INSTALL_PATH . 'plugins/';
    foreach (glob($plugin_dir . '*') as $path)
    {
    foreach (glob($plugin_dir . '*') as $path) {
      if (!is_dir($path)) {
        continue;
      }
      if (is_dir($path) && is_readable($path.'/composer.json'))
      {
      if (is_readable($path.'/composer.json')) {
        $file_json = json_decode(file_get_contents($path.'/composer.json'));
        $plugin_desc = $file_json->description ?: 'N/A';
      }
      else
      {
      else {
        $plugin_desc = 'N/A';
      }
      $name = substr($path, strlen($plugin_dir));
      $plugins[] = array('name' => $name, 'desc' => $plugin_desc, 'enabled' => in_array($name, $this->config['plugins']));
      $plugins[] = array(
        'name'    => $name,
        'desc'    => $plugin_desc,
        'enabled' => in_array($name, (array) $this->config['plugins'])
      );
    }
    return $plugins;