diff --git a/www/libs/Class.Basic.inc b/www/libs/Class.Basic.inc
index 87ac188f..e5d431d1 100644
--- a/www/libs/Class.Basic.inc
+++ b/www/libs/Class.Basic.inc
@@ -203,7 +203,7 @@
if (isset($GLOBALS['PRINT']))
$this->print_output = $GLOBALS['PRINT'];
- // exclude these ones from output
+ // exclude these ones from output
if (isset($GLOBALS['DEBUG_NOT']))
$this->debug_output_not = $GLOBALS['DEBUG_NOT'];
if (isset($GLOBALS['ECHO_NOT']))
@@ -232,12 +232,12 @@
$this->log_per_run = $GLOBALS['LOG_PER_RUN'];
// set the regex for checking emails
- $this->email_regex = "^[A-Za-z0-9!#$%&'*+-\/=?^_`{|}~][A-Za-z0-9!#$%:\(\)&'*+-\/=?^_`{|}~\.]{0,63}@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,6}){1}$";
+ $this->email_regex = "^[A-Za-z0-9!#$%&'*+-\/=?^_`{|}~][A-Za-z0-9!#$%:\(\)&'*+-\/=?^_`{|}~\.]{0,63}@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,}){1}$";
// this is for error check parts in where the email regex failed
$this->email_regex_check = array (
1 => "@(.*)@(.*)", // double @
2 => "^[A-Za-z0-9!#$%&'*+-\/=?^_`{|}~][A-Za-z0-9!#$%:\(\)&'*+-\/=?^_`{|}~\.]{0,63}@", // wrong part before @
- 3 => "@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,6}){1}$", // wrong part after @
+ 3 => "@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,}){1}$", // wrong part after @
4 => "@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.", // wrong domain name part
5 => "\.([a-zA-Z]{2,6}){1}$", // wrong top level part
6 => "@(.*)\.{2,}", // double .. in domain name part
@@ -1698,7 +1698,7 @@
// *** COLORS ***
// METHOD: hex2rgb
- // PARAMS: hexstring, flag to return as string (true/false), string seperator: default: ,
+ // PARAMS: hexstring, flag to return as string (true/false), string seperator: default: ,
// RETURN: array with RGB or a string with the seperator
// DESC: converts a hex RGB color to the int numbers
public static function hex2rgb($hexStr, $returnAsString = false, $seperator = ',')
diff --git a/www/libs/Class.DB.IO.inc b/www/libs/Class.DB.IO.inc
index 5b6a398c..1241f632 100644
--- a/www/libs/Class.DB.IO.inc
+++ b/www/libs/Class.DB.IO.inc
@@ -763,7 +763,7 @@
$this->insert_id[] = $_insert_id;
}
// if we have only one, revert from array to single
- if (count($this->insert_id) >= 1)
+ if (count($this->insert_id) == 1)
{
// echo "* SINGLE DATA CONVERT: ".count($this->insert_id[0])." => ".array_key_exists($this->pk_name, $this->insert_id[0])."
";
// echo "* PK DIRECT: ".$this->insert_id[0][$this->pk_name]."
";
@@ -780,6 +780,7 @@
$this->insert_id = $this->insert_id[0][$this->pk_name];
}
}
+ // if we have non -> error
elseif (count($this->insert_id) == 0)
{
// failed to get insert id
@@ -787,6 +788,7 @@
$this->warning_id = 33;
$this->_db_error($this->cursor, '[db_exec]');
}
+ // if we have multiple, do not set the insert_id different, keep as array
}
// this warning handling is only for pgsql
// we returned an array of PKs instread of a single one
diff --git a/www/libs/Class.Smarty.Extend.inc b/www/libs/Class.Smarty.Extend.inc
index b449cddd..5e8c83bf 100644
--- a/www/libs/Class.Smarty.Extend.inc
+++ b/www/libs/Class.Smarty.Extend.inc
@@ -21,7 +21,7 @@
public function __construct($lang)
{
SmartyBC::__construct();
- _spl_autoload('Class.l10.inc');
+ _spl_autoload('Class.l10n.inc');
$this->l10n = new l10n($lang);
// variable variable register
$this->register_modifier('getvar', array(&$this, 'get_template_vars'));
diff --git a/www/libs/Class.l10n.inc b/www/libs/Class.l10n.inc
index da216324..8601a5f6 100644
--- a/www/libs/Class.l10n.inc
+++ b/www/libs/Class.l10n.inc
@@ -35,7 +35,7 @@
private $input;
private $l10n;
- public function __construct($lang = '', $path = '')
+ public function __construct($lang = '', $path = DEFAULT_TEMPLATE)
{
foreach (array('streams.php', 'gettext.php') as $include_file)
_spl_autoload($include_file);
@@ -45,12 +45,12 @@
else
$this->lang = $lang;
- if (!$path)
- $path = DEFAULT_TEMPLATE;
- if (!is_dir(LAYOUT.$path.LANG))
+ if (is_dir(LAYOUT.$path.LANG))
+ $path = LAYOUT.$path.LANG;
+ elseif (!is_dir($path))
$path = '';
- $this->mofile = LAYOUT.$path.LANG.$this->lang.".mo";
+ $this->mofile = $path.$this->lang.".mo";
// check if get a readable mofile
if (is_readable($this->mofile))
@@ -69,10 +69,12 @@
$this->lang = $lang;
- if (!is_dir(LAYOUT.$path.LANG))
+ if (is_dir(LAYOUT.$path.LANG))
+ $path = LAYOUT.$path.LANG;
+ elseif (!is_dir($path))
$path = '';
- $this->mofile = LAYOUT.$path.LANG.$this->lang.".mo";
+ $this->mofile = $path.$this->lang.".mo";
// check if get a readable mofile
if (is_readable($this->mofile))
diff --git a/www/libs/db_pgsql.inc b/www/libs/db_pgsql.inc
index 98c8da9d..c4b65a67 100644
--- a/www/libs/db_pgsql.inc
+++ b/www/libs/db_pgsql.inc
@@ -67,7 +67,7 @@
{
$this->last_error_query = '';
// read out the query status and save the query if needed
- $result = @pg_query($this->dbh, $query);
+ $result = pg_query($this->dbh, $query);
if (!$result)
$this->last_error_query = $query;
return $result;
@@ -79,7 +79,7 @@
// DESC : sends an async query to the server
public function _db_send_query($query)
{
- return @pg_send_query($this->dbh, $query);
+ return pg_send_query($this->dbh, $query);
}
// METHOD: _db_get_result
@@ -102,8 +102,8 @@
public function _db_close()
{
if (is_resource($this->dbh))
- if (@pg_connection_status($this->dbh) === PGSQL_CONNECTION_OK)
- @pg_close($this->dbh);
+ if (pg_connection_status($this->dbh) === PGSQL_CONNECTION_OK)
+ pg_close($this->dbh);
}
// METHOD: _db_prepare
@@ -112,7 +112,7 @@
// DESC : wrapper for pg_prepare
public function _db_prepare($name, $query)
{
- $result = @pg_prepare($this->dbh, $name, $query);
+ $result = pg_prepare($this->dbh, $name, $query);
if (!$result)
$this->last_error_query = $query;
return $result;
@@ -124,7 +124,7 @@
// DESC : wrapper for pg_execute for running a prepared statement
public function _db_execute($name, $data)
{
- $result = @pg_execute($this->dbh, $name, $data);
+ $result = pg_execute($this->dbh, $name, $data);
if (!$result)
$this->last_error_query = $query;
return $result;
@@ -295,7 +295,7 @@
{
$db_port = 5432;
}
- $this->dbh = @pg_connect("host=".$db_host." port=".$db_port." user=".$db_user." password=".$db_pass." dbname=".$db_name." sslmode=".$db_ssl);
+ $this->dbh = pg_connect("host=".$db_host." port=".$db_port." user=".$db_user." password=".$db_pass." dbname=".$db_name." sslmode=".$db_ssl);
if (!$this->dbh)
{
die("");
@@ -326,7 +326,7 @@
// DESC : wrapper for pg_emta_data
public function _db_meta_data($table)
{
- return @pg_meta_data($this->dbh, $table);
+ return pg_meta_data($this->dbh, $table);
}
// METHOD: _db_escape_string