summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/adodb-mysqli.inc.php17
-rw-r--r--drivers/adodb-postgres7.inc.php6
2 files changed, 7 insertions, 16 deletions
diff --git a/drivers/adodb-mysqli.inc.php b/drivers/adodb-mysqli.inc.php
index 9c98fb9a..6662585e 100644
--- a/drivers/adodb-mysqli.inc.php
+++ b/drivers/adodb-mysqli.inc.php
@@ -1179,12 +1179,8 @@ class ADODB_mysqli extends ADOConnection {
return false;
}
- $this->charSet = @$this->_connectionID->character_set_name();
- if (!$this->charSet) {
-
- } else {
- return $this->charSet;
- }
+ $this->charSet = $this->_connectionID->character_set_name();
+ return $this->charSet ?: false;
}
function setCharSet($charset)
@@ -1194,11 +1190,12 @@ class ADODB_mysqli extends ADOConnection {
}
if ($this->charSet !== $charset) {
- $if = @$this->_connectionID->set_charset($charset);
- return ($if === true & $this->getCharSet() == $charset);
- } else {
- return true;
+ if (!$this->_connectionID->set_charset($charset)) {
+ return false;
+ }
+ $this->getCharSet();
}
+ return true;
}
}
diff --git a/drivers/adodb-postgres7.inc.php b/drivers/adodb-postgres7.inc.php
index 38762bf3..d0fd78ad 100644
--- a/drivers/adodb-postgres7.inc.php
+++ b/drivers/adodb-postgres7.inc.php
@@ -283,12 +283,6 @@ class ADODB_postgres7 extends ADODB_postgres64 {
if (!$this->_connectionID) {
return false;
}
- $this->charSet = @pg_client_encoding($this->_connectionID);
- if (!$this->charSet) {
- return false;
- } else {
- return $this->charSet;
- }
$this->charSet = pg_client_encoding($this->_connectionID);
return $this->charSet ?: false;
}