Merge branch 'QA_4_6' of https://github.com/phpmyadmin/phpmyadmin into QA_4_6

This commit is contained in:
Deven Bansod 2016-11-26 09:48:37 +05:30
commit a2e9a6cbde
2 changed files with 17 additions and 5 deletions

View File

@ -3,6 +3,7 @@ phpMyAdmin - ChangeLog
4.6.6 (not yet released)
- issue #12735 Incorrect parameters to escapeString in Node.php
- issue #12734 Fix PHP error when mbstring is not installed
4.6.5 (2016-11-24)
- issue Remove potentionally license problematic sRGB profile

View File

@ -166,17 +166,28 @@ function _check_locale_and_function($function=false) {
*/
function _get_codeset($domain=null) {
global $text_domains, $default_domain, $LC_CATEGORIES;
if (!isset($domain)) $domain = $default_domain;
return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : ini_get('mbstring.internal_encoding');
if (!isset($domain)) {
$domain = $default_domain;
}
if (isset($text_domains[$domain]->codeset)) {
return $text_domains[$domain]->codeset;
}
if (!empty(ini_get('mbstring.internal_encoding'))) {
return ini_get('mbstring.internal_encoding');
}
return 'utf-8';
}
/**
* Convert the given string to the encoding set by bind_textdomain_codeset.
*/
function _encode($text) {
$source_encoding = mb_detect_encoding($text);
if ($source_encoding === false) {
$source_encoding = 'utf-8';
$source_encoding = 'utf-8';
if (function_exists('mb_detect_encoding')) {
$source_encoding = mb_detect_encoding($text);
if ($source_encoding === false) {
$source_encoding = 'utf-8';
}
}
$target_encoding = _get_codeset();
if ($source_encoding != $target_encoding) {