Merge remote-tracking branch 'origin/QA_4_7' into QA_4_7

This commit is contained in:
Weblate 2017-06-15 16:28:41 +02:00
commit 0251931c3e
6 changed files with 28 additions and 4 deletions

View File

@ -15,6 +15,8 @@ phpMyAdmin - ChangeLog
- issue #13327 Fixed Incorrect NavigationTreeEnableExpansion default value in the documentation
- issue #13008 Fixed export of database with a lot of tables
- issue #13318 Improved performance when importing with enabled tracking
- issue #13386 Avoid PHP errors with non existing configuration on OS X
- issue #13388 Show only supported charsets for conversion
4.7.1 (2017-05-25)
- issue #13132 Always execute tracking queries as controluser

View File

@ -1137,7 +1137,7 @@ class Config
public function checkPermissions()
{
// Check for permissions (on platforms that support it):
if ($this->get('CheckConfigurationPermissions')) {
if ($this->get('CheckConfigurationPermissions') && @file_exists($this->getSource())) {
$perms = @fileperms($this->getSource());
if (!($perms === false) && ($perms & 2)) {
// This check is normally done after loading configuration

View File

@ -325,4 +325,20 @@ class Encoding
. '</label><br />'
. '</li></ul>';
}
}
public static function listEncodings()
{
if (is_null(self::$_engine)) {
self::initEngine();
}
/* Most engines do not support listing */
if (self::$_engine != self::ENGINE_MB) {
return $GLOBALS['cfg']['AvailableCharsets'];
}
return array_intersect(
array_map('strtolower', mb_list_encodings()),
$GLOBALS['cfg']['AvailableCharsets']
);
}
}

View File

@ -639,7 +639,7 @@ function PMA_getHtmlForExportOptionsOutputCharset()
$html = ' <li><label for="select_charset" class="desc">'
. __('Character set of the file:') . '</label>' . "\n";
$html .= '<select id="select_charset" name="charset" size="1">';
foreach ($cfg['AvailableCharsets'] as $temp_charset) {
foreach (Encoding::listEncodings() as $temp_charset) {
$html .= '<option value="' . $temp_charset . '"';
if (isset($_GET['charset'])
&& ($_GET['charset'] != $temp_charset)

View File

@ -181,7 +181,7 @@ function PMA_getHtmlForImportCharset()
$html .= '<label for="charset_of_file">' . __('Character set of the file:')
. '</label>';
$html .= '<select id="charset_of_file" name="charset_of_file" size="1">';
foreach ($cfg['AvailableCharsets'] as $temp_charset) {
foreach (Encoding::listEncodings() as $temp_charset) {
$html .= '<option value="' . htmlentities($temp_charset) . '"';
if ((empty($cfg['Import']['charset']) && $temp_charset == 'utf-8')
|| $temp_charset == $cfg['Import']['charset']

View File

@ -203,4 +203,10 @@ class EncodingTest extends PHPUnit_Framework_TestCase
$actual
);
}
public function testListEncodings()
{
$result = Encoding::listEncodings();
$this->assertContains('utf-8', $result);
}
}