Permalink
Browse files

Save memory

  • Loading branch information...
1 parent 33aec2c commit ef9d6d45122872543eab83b865802e719bd5274c @vrana committed Jan 20, 2011
Showing with 10 additions and 2 deletions.
  1. +9 −1 adminer/include/editing.inc.php
  2. +1 −1 adminer/sql.inc.php
View
10 adminer/include/editing.inc.php
@@ -106,7 +106,15 @@ function referencable_primary($self) {
* @return null
*/
function textarea($name, $value, $rows = 10, $cols = 80) {
- echo "<textarea name='$name' rows='$rows' cols='$cols' style='width: 98%;' spellcheck='false' onkeypress='return textareaKeypress(this, event, true);'>" . h($value) . "</textarea>"; // spellcheck - not valid before HTML5
+ echo "<textarea name='$name' rows='$rows' cols='$cols' style='width: 98%;' spellcheck='false' onkeypress='return textareaKeypress(this, event, true);'>"; // spellcheck - not valid before HTML5
+ if (is_array($value)) {
+ foreach ($value as $val) { // not implode() to save memory
+ echo h($val) . ";\n\n\n"; // rtrim(, ';') would possibly damage DELIMITER
+ }
+ } else {
+ echo h($value);
+ }
+ echo "</textarea>";
}
/** Format time difference
View
2 adminer/sql.inc.php
@@ -147,7 +147,7 @@
if ($_POST) {
$q = $_POST["query"];
} elseif ($_GET["history"] == "all") {
- $q = implode(";\n\n\n", $history); // rtrim(, ';') would possibly damage DELIMITER
+ $q = $history;
} elseif ($_GET["history"] != "") {
$q = $history[$_GET["history"]];
}

0 comments on commit ef9d6d4

Please sign in to comment.