thomascube
2009-11-09 3597cc2c1b22dc29fe1169075601c72fa5c8558c
Plugins should not overwrite existing config props

2 files modified
6 ■■■■ changed files
program/include/rcube_config.php 4 ●●●● patch | view | raw | blame | history
program/include/rcube_plugin.php 2 ●●● patch | view | raw | blame | history
program/include/rcube_config.php
@@ -132,12 +132,12 @@
   * @param string Full path to the config file to be loaded
   * @return booelan True on success, false on failure
   */
  public function load_from_file($fpath)
  public function load_from_file($fpath, $merge = true)
  {
    if (is_file($fpath) && is_readable($fpath)) {
      include($fpath);
      if (is_array($rcmail_config)) {
        $this->prop = array_merge($this->prop, $rcmail_config);
        $this->prop = $merge ? array_merge($this->prop, $rcmail_config) : $this->prop + $rcmail_config;
        return true;
      }
    }
program/include/rcube_plugin.php
@@ -59,7 +59,7 @@
  {
    $fpath = $this->home.'/'.$fname;
    $rcmail = rcmail::get_instance();
    if (!$rcmail->config->load_from_file($fpath)) {
    if (!$rcmail->config->load_from_file($fpath, false)) {
      raise_error(array('code' => 527, 'type' => 'php', 'message' => "Failed to load config from $fpath"), true, false);
      return false;
    }