bug #2974067 non-binary fields shown as hex
This commit is contained in:
@@ -20,6 +20,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
|
|||||||
designer, thanks to Sutharshan Balachandren.
|
designer, thanks to Sutharshan Balachandren.
|
||||||
- bug #2983062, patch #2989408 [engines] Fix warnings when changing table
|
- bug #2983062, patch #2989408 [engines] Fix warnings when changing table
|
||||||
engine to Maria, thanks to Madhura Jayaratne.
|
engine to Maria, thanks to Madhura Jayaratne.
|
||||||
|
- bug #2974067 [display] non-binary fields shown as hex
|
||||||
|
|
||||||
3.3.2.0 (2010-04-13)
|
3.3.2.0 (2010-04-13)
|
||||||
- patch #2969449 [core] Name for MERGE engine varies depending on the
|
- patch #2969449 [core] Name for MERGE engine varies depending on the
|
||||||
|
@@ -2595,6 +2595,17 @@ function PMA_printable_bit_value($value, $length) {
|
|||||||
return $printable;
|
return $printable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies whether the value contains a non-printable character
|
||||||
|
*
|
||||||
|
* @uses preg_match()
|
||||||
|
* @param string $value
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
function PMA_contains_nonprintable_ascii($value) {
|
||||||
|
return preg_match('@[^[:print:]]@', $value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts a BIT type default value
|
* Converts a BIT type default value
|
||||||
* for example, b'010' becomes 010
|
* for example, b'010' becomes 010
|
||||||
|
@@ -1368,7 +1368,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
|
|||||||
if ($_SESSION['tmp_user_values']['display_binary']) {
|
if ($_SESSION['tmp_user_values']['display_binary']) {
|
||||||
// user asked to see the real contents of BINARY
|
// user asked to see the real contents of BINARY
|
||||||
// fields
|
// fields
|
||||||
if ($_SESSION['tmp_user_values']['display_binary_as_hex']) {
|
if ($_SESSION['tmp_user_values']['display_binary_as_hex'] && PMA_contains_nonprintable_ascii($row[$i])) {
|
||||||
$row[$i] = bin2hex($row[$i]);
|
$row[$i] = bin2hex($row[$i]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user