bug 443760

This commit is contained in:
Marc Delisle
2001-07-31 01:29:39 +00:00
parent 5d023a190a
commit 047acbf862
5 changed files with 40 additions and 9 deletions

View File

@@ -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 <lem9@users.sourceforge.net>
* lib.inc.php3: establish constraints for the code, to get

View File

@@ -479,6 +479,14 @@
<br /><br />
</dd>
<dt><b>$cfgProtectBlob </b>boolean</dt>
<dd>
Defines whether <tt>BLOB</tt> fields are protected from edition
when browsing a table's content or not.
<br /><br />
</dd>
<dt><b>$cfgShowSQL </b>boolean</dt>
<dt><b>$cfgShowSQL </b>boolean</dt>
<dd>
Defines whether sql-queries generated by phpMyAdmin should be displayed

View File

@@ -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)

View File

@@ -37,6 +37,9 @@ if (!defined('__LIB_INC__')){
if (!isset($pos)) {
$pos=0;
}
if (!isset($cfgProtectBlob)) {
$cfgProtectBlob=FALSE;
}
/* ---------------------- Advanced authentification -------------------- */
/**

View File

@@ -116,8 +116,14 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
// Change by Bernard M. Piller <bernard@bmpsystems.com>
// 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 ' <td>' . $strBinary . '</td>' . "\n";
} else {
?>
@@ -258,15 +264,25 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) {
}
// Change by Bernard M. Piller <bernard@bmpsystems.com>
// 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";
?>
<td>
<?php echo $strBinaryDoNotEdit . "\n"; ?>
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" />
</td>
<td>
<?php echo $strBinaryDoNotEdit . "\n"; ?>
<input type="hidden" name="fields[<?php echo urlencode($field); ?>]" value="<?php echo $special_chars; ?>" />
</td>
<?php }
else {
?>
<td>
<textarea name="fields[<?php echo urlencode($field); ?>]" rows="<?php echo $cfgTextareaRows; ?>" cols="<?php echo $cfgTextareaCols; ?>">
<?php if (!empty($special_chars)) echo $special_chars . "\n"; ?>
</textarea>
<?php
}
}
else {
$fieldsize = (($len > 40) ? 40 : $len);