Changeset 3102 in subversion


Ignore:
Timestamp:
Nov 9, 2009 11:18:58 AM (4 years ago)
Author:
thomasb
Message:

Plugins should not overwrite existing config props

Location:
trunk/roundcubemail/program/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_config.php

    r2760 r3102  
    133133   * @return booelan True on success, false on failure 
    134134   */ 
    135   public function load_from_file($fpath) 
     135  public function load_from_file($fpath, $merge = true) 
    136136  { 
    137137    if (is_file($fpath) && is_readable($fpath)) { 
    138138      include($fpath); 
    139139      if (is_array($rcmail_config)) { 
    140         $this->prop = array_merge($this->prop, $rcmail_config); 
     140        $this->prop = $merge ? array_merge($this->prop, $rcmail_config) : $this->prop + $rcmail_config; 
    141141        return true; 
    142142      } 
  • trunk/roundcubemail/program/include/rcube_plugin.php

    r3076 r3102  
    6060    $fpath = $this->home.'/'.$fname; 
    6161    $rcmail = rcmail::get_instance(); 
    62     if (!$rcmail->config->load_from_file($fpath)) { 
     62    if (!$rcmail->config->load_from_file($fpath, false)) { 
    6363      raise_error(array('code' => 527, 'type' => 'php', 'message' => "Failed to load config from $fpath"), true, false); 
    6464      return false; 
Note: See TracChangeset for help on using the changeset viewer.