[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_3, updated. RELEASE_3_3_2-21-gacdf39e

Marc Delisle lem9 at users.sourceforge.net
Fri Apr 23 20:01:43 CEST 2010


The branch, QA_3_3 has been updated
       via  acdf39e95b355bc656409b66174afe6b7e0f39c6 (commit)
      from  769aec95effaa407fc62778a23549b902fd586d9 (commit)


- Log -----------------------------------------------------------------
commit acdf39e95b355bc656409b66174afe6b7e0f39c6
Author: Marc Delisle <marc at infomarc.info>
Date:   Fri Apr 23 14:00:53 2010 -0400

    bug #2974067 non-binary fields shown as hex

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                     |    1 +
 libraries/common.lib.php      |   11 +++++++++++
 libraries/display_tbl.lib.php |    2 +-
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4010dda..4bda4f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
   designer, thanks to Sutharshan Balachandren.
 - bug #2983062, patch #2989408 [engines] Fix warnings when changing table
   engine to Maria, thanks to Madhura Jayaratne.
+- bug #2974067 [display] non-binary fields shown as hex
 
 3.3.2.0 (2010-04-13)
 - patch #2969449 [core] Name for MERGE engine varies depending on the
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index f072233..2e18474 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -2596,6 +2596,17 @@ function PMA_printable_bit_value($value, $length) {
 }
 
 /**
+ * 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  
  * for example, b'010' becomes 010 
  *
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index 41bb987..05feefb 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -1368,7 +1368,7 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
                         if ($_SESSION['tmp_user_values']['display_binary']) {
                             // user asked to see the real contents of BINARY
                             // 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]);
 							}
 							else {


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list