]> git.pld-linux.org Git - packages/ZendFramework.git/commitdiff
- http://framework.zend.com/issues/secure/attachment/11545/charset.diff
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 9 Jan 2009 14:45:42 +0000 (14:45 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
  from http://framework.zend.com/issues/browse/ZF-1541

Changed files:
    ZendFramework-db_charset.patch -> 1.1

ZendFramework-db_charset.patch [new file with mode: 0644]

diff --git a/ZendFramework-db_charset.patch b/ZendFramework-db_charset.patch
new file mode 100644 (file)
index 0000000..049ee22
--- /dev/null
@@ -0,0 +1,65 @@
+Index: Zend/Db/Adapter/Mysqli.php
+===================================================================
+--- Zend/Db/Adapter/Mysqli.php (revision 11422)
++++ Zend/Db/Adapter/Mysqli.php (working copy)
+@@ -313,6 +313,10 @@
+             require_once 'Zend/Db/Adapter/Mysqli/Exception.php';
+             throw new Zend_Db_Adapter_Mysqli_Exception(mysqli_connect_error());
+         }
++        
++        if(array_key_exists('charset', $this->_config)) {
++            $this->_connection->set_charset($this->_config['charset']);
++        }
+     }
+     /**
+Index: Zend/Db/Adapter/Pdo/Mysql.php
+===================================================================
+--- Zend/Db/Adapter/Pdo/Mysql.php      (revision 11422)
++++ Zend/Db/Adapter/Pdo/Mysql.php      (working copy)
+@@ -93,6 +93,20 @@
+     {
+         return $this->fetchCol('SHOW TABLES');
+     }
++    
++    /**
++     * @return void
++     */
++    protected function _connect()
++    {
++        if ($this->_connection) {
++            return;
++        }
++        parent::_connect();
++        if (array_key_exists('charset', $this->_config)) {
++            $this->_connection->exec('SET NAMES ' . $this->_quote($this->_config['charset']));
++        }
++    }
+     /**
+      * Returns the column descriptions for a table.
+Index: Zend/Db/Adapter/Pdo/Pgsql.php
+===================================================================
+--- Zend/Db/Adapter/Pdo/Pgsql.php      (revision 11422)
++++ Zend/Db/Adapter/Pdo/Pgsql.php      (working copy)
+@@ -71,6 +71,20 @@
+         'NUMERIC'            => Zend_Db::FLOAT_TYPE,
+         'REAL'               => Zend_Db::FLOAT_TYPE
+     );
++    
++    /**
++     * @return void
++     */
++    protected function _connect()
++    {
++        if ($this->_connection) {
++            return;
++        }
++        parent::_connect();
++        if (array_key_exists('charset', $this->_config)) {
++            $this->_connection->exec('SET NAMES ' . $this->_quote($this->_config['charset']));
++        }
++    }
+     /**
+      * Returns a list of the tables in the database.
This page took 0.057727 seconds and 4 git commands to generate.