Index: design/standard/templates/setup/db/mysqli_info.tpl
===================================================================
--- design/standard/templates/setup/db/mysqli_info.tpl	(revision 0)
+++ design/standard/templates/setup/db/mysqli_info.tpl	(revision 0)
@@ -0,0 +1,18 @@
+{* DO NOT EDIT THIS FILE! Use an override template instead. *}
+<h2>{"MySQL Improved"|i18n("design/standard/setup/db")}</h2>
+<h3>{"Introduction"|i18n("design/standard/setup/db")}</h3>
+<p>
+  {"MySQL is a database management system created by MySQL AB."|i18n("design/standard/setup/db")}
+  {"It is one of the most popular databases in the Open Source community and most often on by default in PHP."|i18n("design/standard/setup/db")}
+</p>
+<p>{"From their homepage"|i18n("design/standard/setup/db")}:</p>
+<div class="quote">{"MySQL is the world's most popular Open Source Database, designed for speed, power and precision in mission critical, heavy load use."|i18n("design/standard/setup/db")}</div>
+<p>{"More information can be found on"|i18n("design/standard/setup/db")} <a href="http://www.mysql.com">mysql.com</a>.</p>
+
+<h3>{"Details"|i18n("design/standard/setup/db")}</h3>
+<p>{"MySQL is a good choice for handling most western languages, and as of version 4.1 it also supports Unicode."|i18n("design/standard/setup/db")}</p>
+
+<h3>{"Installation"|i18n("design/standard/setup/db")}</h3>
+<p>{"By using the"|i18n("design/standard/setup/db")} <tt class="option">--with-mysqli</tt> {"configuration option you enable PHP to access MySQL databases through the MySQL Improved extension. If you use this option without specifying the path to MySQL, PHP will use the built-in MySQL client libraries."|i18n("design/standard/setup/db")}</p>
+
+<p>{"More information on the MySQLi extension can be found at"|i18n("design/standard/setup/db")} <a href="http://www.php.net/manual/en/ref.mysqli.php">php.net</a>.</p>
Index: design/standard/templates/setup/init/database_init.tpl
===================================================================
--- design/standard/templates/setup/init/database_init.tpl	(revision 20528)
+++ design/standard/templates/setup/init/database_init.tpl	(working copy)
@@ -108,7 +108,7 @@
   <td class="normal"><label class="textfield">{"Password"|i18n("design/standard/setup/init")}:</label></td>
   <td class="normal"><input type="password" name="eZSetupDatabasePassword" size="16" value="{$database_info.password|wash}" /></td>
 </tr>
-{section show=eq($database_info.info.driver,'ezmysql')}
+{section show=or(eq($database_info.info.driver,'ezmysql'), eq($database_info.info.driver,'ezmysqli'))}
 <tr>
   <td class="normal"><label class="textfield">{"Socket (optional)"|i18n("design/standard/setup/init")}:</label></td>
   <td class="normal"><input type="text" name="eZSetupDatabaseSocket" size="16" value="{$database_info.socket|wash}" /></td>
Index: kernel/setup/ezsetupcommon.php
===================================================================
--- kernel/setup/ezsetupcommon.php	(revision 20528)
+++ kernel/setup/ezsetupcommon.php	(working copy)
@@ -64,7 +64,14 @@
                                     'name' => 'PostgreSQL',
                                     'required_version' => '7.3',
                                     'has_demo_data' => false,
-                                    'supports_unicode' => true ) );
+                                    'supports_unicode' => true ),
+                  'mysqli' => array( 'type' => 'mysqli',
+                                     'driver' => 'ezmysqli',
+                                     'name' => 'MySQL Improved',
+                                     'required_version' => '4.1.1',
+                                     'has_demo_data' => true,
+                                     'supports_unicode' => true )
+                   );
 }
 
 function eZSetupFetchPersistenceList()
@@ -196,6 +203,7 @@
         foreach ( $acceptLanguages as $acceptLanguage )
         {
             list( $acceptLanguageCode ) = explode( ';', $acceptLanguage );
+            $acceptLanguageCode = strtolower( $acceptLanguageCode );
             $languageCode = false;
             if ( isset( $httpMap[$acceptLanguageCode] ) )
             {
Index: lib/ezdb/classes/ezmysqlidb.php
===================================================================
--- lib/ezdb/classes/ezmysqlidb.php	(revision 20528)
+++ lib/ezdb/classes/ezmysqlidb.php	(working copy)
@@ -195,7 +195,7 @@
     */
     function databaseName()
     {
-        return 'mysqli';
+        return 'mysql';
     }
 
     /*!
Index: lib/ezdbschema/classes/ezmysqlschema.php
===================================================================
--- lib/ezdbschema/classes/ezmysqlschema.php	(revision 20528)
+++ lib/ezdbschema/classes/ezmysqlschema.php	(working copy)
@@ -684,26 +684,12 @@
     */
     function escapeSQLString( $value )
     {
-        // We use the mysql function if it exists
-        // if not we use a custom replace method that should sufficient
-        if ( function_exists( 'mysql_real_escape_string' ) )
-            return mysql_real_escape_string( $value );
-        else
-            str_replace( array( "\\",
-                                "'",
-                                '"',
-                                "\x00",
-                                "\x1a",
-                                "\n",
-                                "\r" ),
-                         array( "\\\\",
-                                "\\'",
-                                "\\\"",
-                                "\\0",
-                                "\\Z",
-                                "\\n",
-                                "\\r" ),
-                         $value );
+        if ( $this->DBInstance instanceof eZDBInterface )
+        {
+            return $this->DBInstance->escapeString( $value );
+        }
+
+        return $value;
     }
 
     /*!
Index: settings/setup.ini
===================================================================
--- settings/setup.ini	(revision 20528)
+++ settings/setup.ini	(working copy)
@@ -40,11 +40,11 @@
 Require=all
 
 [database_extensions]
-Extensions=mysql;pgsql
+Extensions=mysql;pgsql;mysqli
 Require=one
 
 [database_all_extensions]
-Extensions=mysql;pgsql
+Extensions=mysql;pgsql;mysqli
 Require=all
 
 [image_conversion]
