bug #2107583 [GUI] Leading newline truncated, thanks to Isart Montane
This commit is contained in:
@@ -7,6 +7,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
|
||||
|
||||
3.0.2.0 (not yet released)
|
||||
- [lang] Italian update, thanks to Luca and fantu
|
||||
- bug #2107583 [GUI] Leading newline truncated, thanks to Isart Montane
|
||||
|
||||
3.0.1.0 (2008-10-22)
|
||||
- bug #2134126 [GUI] SQL error after sorting a subset
|
||||
|
@@ -2610,4 +2610,21 @@ function PMA_replace_binary_contents($content) {
|
||||
$result = str_replace("\x1a", '\Z', $result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* If the first character given is \n (CR) we will add an extra \n
|
||||
*
|
||||
* @uses strpos()
|
||||
* @return string with the chars replaced
|
||||
*/
|
||||
|
||||
function PMA_duplicateFirstNewline($string){
|
||||
$first_occurence = strpos($string, "\n");
|
||||
if($first_occurence == 1){
|
||||
$string = "\n".$string;
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -429,6 +429,10 @@ foreach ($rows as $row_id => $vrow) {
|
||||
$vrow[$field['Field']] = PMA_replace_binary_contents($vrow[$field['Field']]);
|
||||
} // end if
|
||||
$special_chars = htmlspecialchars($vrow[$field['Field']]);
|
||||
|
||||
//We need to duplicate the first \n or otherwise we will lose the first newline entered in a VARCHAR or TEXT column
|
||||
$special_chars_encoded = PMA_duplicateFirstNewline($special_chars);
|
||||
|
||||
$data = $vrow[$field['Field']];
|
||||
} // end if... else...
|
||||
// loic1: if a timestamp field value is not included in an update
|
||||
@@ -657,7 +661,7 @@ foreach ($rows as $row_id => $vrow) {
|
||||
id="field_<?php echo ($idindex); ?>_3"
|
||||
<?php echo $unnullify_trigger; ?>
|
||||
tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"
|
||||
><?php echo $special_chars; ?></textarea>
|
||||
><?php echo $special_chars_encoded; ?></textarea>
|
||||
<?php
|
||||
} elseif (strstr($field['pma_type'], 'text')) {
|
||||
echo $backup_field . "\n";
|
||||
@@ -669,7 +673,7 @@ foreach ($rows as $row_id => $vrow) {
|
||||
id="field_<?php echo ($idindex); ?>_3"
|
||||
<?php echo $unnullify_trigger; ?>
|
||||
tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"
|
||||
><?php echo $special_chars; ?></textarea>
|
||||
><?php echo $special_chars_encoded; ?></textarea>
|
||||
<?php
|
||||
echo "\n";
|
||||
if (strlen($special_chars) > 32000) {
|
||||
@@ -812,7 +816,7 @@ foreach ($rows as $row_id => $vrow) {
|
||||
id="field_<?php echo ($idindex); ?>_3"
|
||||
<?php echo $unnullify_trigger; ?>
|
||||
tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"
|
||||
><?php echo $special_chars; ?></textarea>
|
||||
><?php echo $special_chars_encoded; ?></textarea>
|
||||
<?php
|
||||
|
||||
} else {
|
||||
@@ -889,7 +893,7 @@ foreach ($rows as $row_id => $vrow) {
|
||||
id="field_<?php echo ($idindex); ?>_3"
|
||||
<?php echo $unnullify_trigger; ?>
|
||||
tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"
|
||||
><?php echo $special_chars; ?></textarea>
|
||||
><?php echo $special_chars_encoded; ?></textarea>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
|
Reference in New Issue
Block a user