diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index 9e47557d..97d011eb 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -719,8 +719,14 @@ function input($field, $value, $function) {
}
} elseif (ereg('blob|bytea|raw|file', $field["type"]) && ini_bool("file_uploads")) {
echo "";
- } elseif (ereg('text|lob', $field["type"])) {
- echo "'; // 1.2em - line-height
+ } elseif (($text = ereg('text|lob', $field["type"])) || ereg("\n", $value)) {
+ if ($text && $jush != "sqlite") {
+ $attrs .= " cols='50' rows='12'";
+ } else {
+ $rows = min(12, substr_count($value, "\n") + 1);
+ $attrs .= " cols='30' rows='$rows'" . ($rows == 1 ? " style='height: 1.2em;'" : ""); // 1.2em - line-height
+ }
+ echo "';
} else {
// int(3) is only a display hint
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
diff --git a/adminer/static/functions.js b/adminer/static/functions.js
index ebf9077d..b731c97d 100644
--- a/adminer/static/functions.js
+++ b/adminer/static/functions.js
@@ -391,6 +391,7 @@ function selectDblClick(td, event, text) {
return;
}
var original = td.innerHTML;
+ text = text || /\n/.test(original);
var input = document.createElement(text ? 'textarea' : 'input');
input.onkeydown = function (event) {
if (!event) {
diff --git a/changes.txt b/changes.txt
index c75bd09b..cf7a5976 100644
--- a/changes.txt
+++ b/changes.txt
@@ -1,4 +1,5 @@
Adminer 3.5.2-dev:
+Edit strings with \n in textarea
Style logout button as link
Adminer 3.5.1 (released 2012-08-10):