]> git.joonet.de Git - adminer.git/commitdiff
Save memory
authorJakub Vrana <jakub@vrana.cz>
Thu, 20 Jan 2011 22:12:34 +0000 (23:12 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 20 Jan 2011 22:12:34 +0000 (23:12 +0100)
adminer/include/editing.inc.php
adminer/sql.inc.php

index 36b6a451c94f5dd09512456ddaaaebb8635522b4..abc9a5dabe09a60741aab22d5622ac679bbcbbab 100644 (file)
@@ -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
index 48c8fbe8aab046b1a152354acf4bf09a41feb989..5e18eb32499fef8084db75ab5937b43c3369ab02 100644 (file)
@@ -147,7 +147,7 @@ $q = $_GET["sql"]; // overwrite $q from if ($_POST) to save memory
 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"]];
 }