From 0108768810a47a03e42f205ee6fa1cd5bd8ef439 Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Tue, 21 Aug 2007 11:10:07 -0400 Subject: [PATCH] Several fixes to avoid strict warnings. Made a variable public in db_mysql.inc.php. Added missing language tokens to en_users.lng --- interface/lib/classes/db_mysql.inc.php | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/interface/lib/classes/db_mysql.inc.php b/interface/lib/classes/db_mysql.inc.php index 564b7b6..ccfaa63 100644 --- a/interface/lib/classes/db_mysql.inc.php +++ b/interface/lib/classes/db_mysql.inc.php @@ -49,7 +49,7 @@ private $errorNumber = 0; // last error number public $errorMessage = ''; // last error message private $errorLocation = '';// last error location - private $show_error_messages = false; + public $show_error_messages = false; public function __construct() { @@ -252,7 +252,7 @@ foreach($columns as $col){ $sql .= $col['name'].' '.$this->mapType($col['type'], $col['typeValue']).' '; //* Set default value - if($col['defaultValue'] != '') { + if(isset($col['defaultValue']) && $col['defaultValue'] != '') { if($col['defaultValue'] == 'NULL' or $col['defaultValue'] == 'NOT NULL') { $sql .= 'DEFAULT '.$col['defaultValue'].' '; } else { @@ -261,19 +261,19 @@ } elseif($col['defaultValue'] != false) { $sql .= "DEFAULT '' "; } - if($col['defaultValue'] != 'NULL' && $col['defaultValue'] != 'NOT NULL') { + if(isset($col['defaultValue']) && $col['defaultValue'] != 'NULL' && $col['defaultValue'] != 'NOT NULL') { if($col['notNull'] == true) { $sql .= 'NOT NULL '; } else { $sql .= 'NULL '; } } - if($col['autoInc'] == true){ $sql .= 'auto_increment '; } + if(isset($col['autoInc']) && $col['autoInc'] == true){ $sql .= 'auto_increment '; } $sql.= ','; //* Index Definitions - if($col['option'] == 'primary'){ $index .= 'PRIMARY KEY ('.$col['name'].'),'; } - if($col['option'] == 'index'){ $index .= 'INDEX ('.$col['name'].'),'; } - if($col['option'] == 'unique'){ $index .= 'UNIQUE ('.$col['name'].'),'; } + if(isset($col['option']) && $col['option'] == 'primary'){ $index .= 'PRIMARY KEY ('.$col['name'].'),'; } + if(isset($col['option']) && $col['option'] == 'index'){ $index .= 'INDEX ('.$col['name'].'),'; } + if(isset($col['option']) && $col['option'] == 'unique'){ $index .= 'UNIQUE ('.$col['name'].'),'; } } $sql .= $index; $sql = substr($sql,0,-1); -- Gitblit v1.9.1