Commit 86e6990d authored by Marius Cramer's avatar Marius Cramer

- checked and fixed usage of empty()

parent 7de1b7b5
......@@ -51,7 +51,7 @@ class installer extends installer_dist {
if (trim($line) != '' && substr($line, 0, 1) != '#')
{
@list($key, $value) = @explode("=", $line);
if (!empty($value))
if (isset($value) && $value !== '')
{
$key = rtrim($key);
$old_options[$key] = trim($value);
......@@ -112,6 +112,7 @@ class installer extends installer_dist {
// amavisd user config file
$configfile = 'fedora_amavisd_conf';
if(!is_dir($conf["amavis"]["config_dir"])) mkdir($conf["amavis"]["config_dir"]);
if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) copy($conf["amavis"]["config_dir"].'/amavisd.conf', $conf["amavis"]["config_dir"].'/amavisd.conf~');
if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~');
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/".$configfile.".master");
......
......@@ -51,7 +51,7 @@ class installer extends installer_dist {
if (trim($line) != '' && substr($line, 0, 1) != '#')
{
@list($key, $value) = @explode("=", $line);
if (!empty($value))
if (isset($value) && $value !== '')
{
$key = rtrim($key);
$old_options[$key] = trim($value);
......@@ -112,9 +112,9 @@ class installer extends installer_dist {
// amavisd user config file
$configfile = 'fedora_amavisd_conf';
if(!is_dir($conf["amavis"]["config_dir"])) mkdir($conf["amavis"]["config_dir"]);
if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf')) copy($conf["amavis"]["config_dir"].'/amavisd.conf', $conf["amavis"]["config_dir"].'/amavisd.conf~');
if(is_file($conf["amavis"]["config_dir"].'/amavisd.conf~')) exec('chmod 400 '.$conf["amavis"]["config_dir"].'/amavisd.conf~');
if(!is_dir($conf["amavis"]["config_dir"])) mkdir($conf["amavis"]["config_dir"]);
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', "tpl/".$configfile.".master");
$content = str_replace('{mysql_server_ispconfig_user}', $conf['mysql']['ispconfig_user'], $content);
$content = str_replace('{mysql_server_ispconfig_password}', $conf['mysql']['ispconfig_password'], $content);
......
......@@ -51,7 +51,7 @@ class installer extends installer_dist {
if (trim($line) != '' && substr($line, 0, 1) != '#')
{
@list($key, $value) = @explode("=", $line);
if (!empty($value))
if (isset($value) && $value !== '')
{
$key = rtrim($key);
$old_options[$key] = trim($value);
......
......@@ -51,7 +51,7 @@ class installer_dist extends installer_base {
if (trim($line) != '' && substr($line, 0, 1) != '#')
{
@list($key, $value) = @explode("=", $line);
if (!empty($value))
if (isset($value) && $value !== '')
{
$key = rtrim($key);
$old_options[$key] = trim($value);
......
......@@ -67,7 +67,7 @@ class installer_dist extends installer_base {
if (trim($line) != '' && substr($line, 0, 1) != '#')
{
@list($key, $value) = @explode("=", $line);
if (!empty($value))
if (isset($value) && $value !== '')
{
$key = rtrim($key);
$old_options[$key] = trim($value);
......
......@@ -616,7 +616,7 @@ class installer_base {
if (trim($line) != '' && substr($line, 0, 1) != '#')
{
@list($key, $value) = @explode("=", $line);
if (!empty($value))
if (isset($value) && $value !== '')
{
$key = rtrim($key);
$old_options[$key] = trim($value);
......
......@@ -240,7 +240,7 @@ class app {
}
$this->_language_inc = 1;
}
if(!empty($this->_wb[$text])) {
if(isset($this->_wb[$text]) && $this->wb[$text] !== '') {
$text = $this->_wb[$text];
} else {
if($this->_conf['debug_language']) {
......
......@@ -447,7 +447,7 @@ class tform_base {
if(is_array($field['value'])) {
foreach($field['value'] as $k => $v) {
$selected = ($k == $val)?' SELECTED':'';
if(!empty($this->wordbook[$v]))
if(isset($this->wordbook[$v]))
$v = $this->wordbook[$v];
$out .= "<option value='$k'$selected>".$this->lng($v)."</option>\r\n";
}
......@@ -881,7 +881,7 @@ class tform_base {
}
break;
case 'NOTEMPTY':
if(empty($field_value)) {
if(!isset($field_value) || $field_value === '') {
$errmsg = $validator['errmsg'];
if(isset($this->wordbook[$errmsg])) {
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
......
......@@ -190,7 +190,7 @@ class file{
// @ext_save : 1 for YES, 0 for NO - meaning it will filter out system files or not (such as .htaccess)
$dirname = realpath($dirname);
if (!$exts || empty($exts) || $exts == '') {
if (empty($exts)) {
$exts = array('jpg', 'gif', 'jpeg', 'png');
}
if ($handle = opendir($dirname)) {
......
......@@ -115,7 +115,7 @@ class mailman_plugin {
function update_config() {
global $app, $conf;
copy($this->mailman_config_dir.'mm_cfg.py', $this->mailman_config_dir.'mm_cfg.py');
copy($this->mailman_config_dir.'mm_cfg.py', $this->mailman_config_dir.'mm_cfg.py~');
// load the server configuration options
$app->uses('getconf');
......@@ -136,7 +136,7 @@ class mailman_plugin {
if (strlen($line) && substr($line, 0, 1) != '#')
{
list($key, $value) = explode("=", $line);
if (!empty($value))
if ($value && $value !== '')
{
$key = rtrim($key);
$old_options[$key] = trim($value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment