From a9eab4cad13f8614f7c657ce5d2b70035de5912f Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Thu, 20 Mar 2008 16:38:21 +0000 Subject: [PATCH] Space in type (bug 1896054) git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@382 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- editing.inc.php | 2 +- functions.inc.php | 2 +- procedure.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/editing.inc.php b/editing.inc.php index 97aee9d1..904212b2 100644 --- a/editing.inc.php +++ b/editing.inc.php @@ -177,7 +177,7 @@ function normalize_enum($match) { function routine($name, $type) { global $mysql, $enum_length, $inout; $aliases = array("bit" => "tinyint", "bool" => "tinyint", "boolean" => "tinyint", "integer" => "int", "double precision" => "float", "real" => "float", "dec" => "decimal", "numeric" => "decimal", "fixed" => "decimal", "national char" => "char", "national varchar" => "varchar"); - $type_pattern = "([ a-z]+)(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?"; + $type_pattern = "([a-z]+)(?:\\s*\\(((?:[^'\")]*|$enum_length)+)\\))?\\s*(zerofill\\s*)?(unsigned(?:\\s+zerofill)?)?(?:\\s*(?:CHARSET|CHARACTER\\s+SET)\\s*['\"]?([^'\"\\s]+)['\"]?)?"; $pattern = "\\s*(" . ($type == "FUNCTION" ? "" : implode("|", $inout)) . ")?\\s*(?:`((?:[^`]+|``)*)`\\s*|\\b(\\S+)\\s+)$type_pattern"; $create = $mysql->result($mysql->query("SHOW CREATE $type " . idf_escape($name)), 2); preg_match("~\\(((?:$pattern\\s*,?)*)\\)" . ($type == "FUNCTION" ? "\\s*RETURNS\\s+$type_pattern" : "") . "\\s*(.*)~is", $create, $match); diff --git a/functions.inc.php b/functions.inc.php index 12c869c7..6319ea74 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -18,7 +18,7 @@ function optionlist($options, $selected = array()) { if (is_array($v)) { $return .= ''; } - foreach ((is_array($v) ? $v : array($k => $v)) as $key => $val) { + foreach ((is_array($v) ? $v : array($v)) as $val) { $checked = in_array($val, (array) $selected, true); $return .= '' . htmlspecialchars($val) . ''; } diff --git a/procedure.inc.php b/procedure.inc.php index e9629ce0..2d94abd1 100644 --- a/procedure.inc.php +++ b/procedure.inc.php @@ -56,7 +56,7 @@ if ($_POST) {
- +