default function makes string formatting.
This commit is contained in:
@@ -5,6 +5,13 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2003-07-10 Garvin Hicking <me@supergarv.de>
|
||||||
|
* libraries/display_tbl.lib.php3: Let the default function take
|
||||||
|
the honor to replace special strings, so that a non-default function
|
||||||
|
does not necessary have them introduced. Very convenient for the
|
||||||
|
text/plain->formatted display, which would otherwise get every
|
||||||
|
CR/LF converted to a <br> and introduce nasty skew.
|
||||||
|
|
||||||
2003-07-10 Marc Delisle <lem9@users.sourceforge.net>
|
2003-07-10 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* pdf_schema.php3: do not display a foreign table if it's not selected
|
* pdf_schema.php3: do not display a foreign table if it's not selected
|
||||||
by user to be on the schema
|
by user to be on the schema
|
||||||
|
@@ -1085,7 +1085,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// garvin: Wrap MIME-transformations. [MIME]
|
// garvin: Wrap MIME-transformations. [MIME]
|
||||||
$default_function = 'htmlspecialchars'; // default_function
|
$default_function = 'default_function'; // default_function
|
||||||
$transform_function = $default_function;
|
$transform_function = $default_function;
|
||||||
$transform_options = array();
|
$transform_options = array();
|
||||||
|
|
||||||
@@ -1214,8 +1214,6 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
|||||||
// loic1: displays all space characters, 4 space
|
// loic1: displays all space characters, 4 space
|
||||||
// characters for tabulations and <cr>/<lf>
|
// characters for tabulations and <cr>/<lf>
|
||||||
$row[$pointer] = ($default_function != $transform_function ? $transform_function($row[$pointer], $transform_options) : $default_function($row[$pointer]));
|
$row[$pointer] = ($default_function != $transform_function ? $transform_function($row[$pointer], $transform_options) : $default_function($row[$pointer]));
|
||||||
$row[$pointer] = str_replace("\011", ' ', str_replace(' ', ' ', $row[$pointer]));
|
|
||||||
$row[$pointer] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$pointer]);
|
|
||||||
|
|
||||||
$vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '">' . $row[$pointer] . '</td>' . "\n";
|
$vertical_display['data'][$row_no][$i] = ' <td valign="top" ' . $column_style . ' bgcolor="' . $bgcolor . '">' . $row[$pointer] . '</td>' . "\n";
|
||||||
} else {
|
} else {
|
||||||
@@ -1250,8 +1248,6 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
|||||||
// characters for tabulations and <cr>/<lf>
|
// characters for tabulations and <cr>/<lf>
|
||||||
else {
|
else {
|
||||||
$row[$pointer] = ($default_function != $transform_function ? $transform_function($row[$pointer], $transform_options) : $default_function($row[$pointer]));
|
$row[$pointer] = ($default_function != $transform_function ? $transform_function($row[$pointer], $transform_options) : $default_function($row[$pointer]));
|
||||||
$row[$pointer] = str_replace("\011", ' ', str_replace(' ', ' ', $row[$pointer]));
|
|
||||||
$row[$pointer] = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $row[$pointer]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// garvin: transform functions may enable nowrapping:
|
// garvin: transform functions may enable nowrapping:
|
||||||
@@ -1674,5 +1670,12 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) {
|
|||||||
}
|
}
|
||||||
} // end of the 'PMA_displayTable()' function
|
} // end of the 'PMA_displayTable()' function
|
||||||
|
|
||||||
|
function default_function($buffer) {
|
||||||
|
$buffer = htmlspecialchars($buffer);
|
||||||
|
$buffer = str_replace("\011", ' ', str_replace(' ', ' ', $buffer));
|
||||||
|
$buffer = ereg_replace("((\015\012)|(\015)|(\012))", '<br />', $buffer);
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
} // $__PMA_DISPLAY_TBL_LIB__
|
} // $__PMA_DISPLAY_TBL_LIB__
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user