From 047acbf86281e62399657c965e3d241d49411ec7 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 31 Jul 2001 01:29:39 +0000 Subject: [PATCH] bug 443760 --- ChangeLog | 3 +++ Documentation.html | 8 ++++++++ config.inc.php3 | 1 + lib.inc.php3 | 3 +++ tbl_change.php3 | 34 +++++++++++++++++++++++++--------- 5 files changed, 40 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index e273c9ca0..108eba05d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ $Source$ * merge Loic's version to cvs * spanish.inc.php3 updates, thanks to gginard@navegalia.com + * tbl_change.php3: bug 443760: binary attribute does not mean that + the contents is binary, so they should be editable + * new $cfgProtectBlob, protecting editing of blobs is optional 2001-07-28 Marc Delisle * lib.inc.php3: establish constraints for the code, to get diff --git a/Documentation.html b/Documentation.html index c0df9c833..af69f2869 100755 --- a/Documentation.html +++ b/Documentation.html @@ -479,6 +479,14 @@

+
$cfgProtectBlob boolean
+
+ Defines whether BLOB fields are protected from edition + when browsing a table's content or not. +

+
+ +
$cfgShowSQL boolean
$cfgShowSQL boolean
Defines whether sql-queries generated by phpMyAdmin should be displayed diff --git a/config.inc.php3 b/config.inc.php3 index 0abcbcfcb..abbbaff41 100755 --- a/config.inc.php3 +++ b/config.inc.php3 @@ -79,6 +79,7 @@ unset($cfgServers[0]); $cfgConfirm = TRUE; $cfgPersistentConnections = FALSE; $cfgShowBlob = FALSE; +$cfgProtectBlob = FALSE; $cfgShowSQL = TRUE; $cfgSkipLockedTables = FALSE; // mark used tables, make possible to show // locked tables (since MySQL 3.23.30) diff --git a/lib.inc.php3 b/lib.inc.php3 index 89bd70b4c..af0ad6b75 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -37,6 +37,9 @@ if (!defined('__LIB_INC__')){ if (!isset($pos)) { $pos=0; } + if (!isset($cfgProtectBlob)) { + $cfgProtectBlob=FALSE; + } /* ---------------------- Advanced authentification -------------------- */ /** diff --git a/tbl_change.php3 b/tbl_change.php3 index 16d32fd25..7c90e73be 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -116,8 +116,14 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { // Change by Bernard M. Piller // We don't want binary data to be destroyed - if ((strstr($row_table_def['Type'], 'blob') || strstr($row_table_def['Type'], 'binary')) - && !empty($data)) { + // Note: from the MySQL manual: "BINARY doesn't affect how the column + // is stored or retrieved" so it does not mean that the contents + // is binary + + //if ((strstr($row_table_def['Type'], 'blob') || strstr($row_table_def['Type'], 'binary')) + if (strstr($row_table_def['Type'], 'blob') + && !empty($data) + && $cfgProtectBlob==TRUE) { echo ' ' . $strBinary . '' . "\n"; } else { ?> @@ -258,15 +264,25 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { } // Change by Bernard M. Piller // We don't want binary data destroyed - else if ((strstr($row_table_def['Type'], 'blob') || strstr($row_table_def['Type'], 'binary')) - && !empty($data)) { - echo "\n"; + else if (strstr($row_table_def['Type'], 'blob') + && !empty($data)) { + if ($cfgProtectBlob==TRUE) { + echo "\n"; ?> - - - - + + + + + + + + 40) ? 40 : $len);