Skip to content

Commit

Permalink
UTF-8 Multibyte (utf8mb4) support
Browse files Browse the repository at this point in the history
Joomla! web installer: downgrade utf8mb4 to utf8 when there's no multibyte support in the database server
  • Loading branch information
Nicholas K. Dionysopoulos committed Jun 13, 2015
1 parent 98a4d14 commit 096d33c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions installation/model/database.php
Expand Up @@ -896,6 +896,14 @@ public function populateDatabase($db, $schema)
// If the query isn't empty and is not a MySQL or PostgreSQL comment, execute it.
if (!empty($query) && ($query{0} != '#') && ($query{0} != '-'))
{
/**
* If we don't have UTF-8 Multibyte support we'll have to convert queries to plain UTF-8
*
* Note: the JDatabaseDriver::convertUtf8mb4QueryToUtf8 performs the conversion ONLY when
* necessary, so there's no need to check the conditions in JInstaller.
*/
$query = $db->convertUtf8mb4QueryToUtf8($query);

// Execute the query.
$db->setQuery($query);

Expand Down

0 comments on commit 096d33c

Please sign in to comment.