Fix: define an array by default if not exist

This commit is contained in:
Regis Houssin 2012-02-24 13:56:32 +08:00
parent a68ac56e5b
commit d7f92041c2

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Jean Heimburger <jean@tiaris.info>
*
@ -160,6 +160,7 @@ class Conf
$modulename = strtolower($reg[1]);
$partname = strtolower($reg[2]);
$varname = $partname.'_modules';
$this->$varname = array();
$arrValue = unserialize($value);
if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue;
else $value = ($value == 1 ? '/'.$modulename.'/core/'.$partname.'/' : $value);