]> git.joonet.de Git - adminer.git/commitdiff
Separate process_length()
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 25 Jul 2007 15:29:56 +0000 (15:29 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 25 Jul 2007 15:29:56 +0000 (15:29 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@249 7c3ca157-0c34-0410-bff1-cbf682f78f5c

editing.inc.php
functions.inc.php

index 61413256eff9e512db4f4407cb2c0e203274748a..8aac7cb5f5a57844ec319a0dc7fd24d3017a6a00 100644 (file)
@@ -73,7 +73,7 @@ function edit_type($key, $field, $collations) {
 function process_type($field, $collate = "COLLATE") {
        global $mysql, $enum_length, $unsigned;
        return " $field[type]"
-               . ($field["length"] ? "(" . (preg_match("~^\\s*(?:$enum_length)(?:\\s*,\\s*(?:$enum_length))*\\s*\$~", $field["length"]) && preg_match_all("~$enum_length~", $field["length"], $matches) ? implode(",", $matches[0]) : preg_replace('~[^0-9,]~', '', $field["length"])) . ")" : "")
+               . ($field["length"] ? "(" . process_length($field["length"]) . ")" : "")
                . (preg_match('~int|float|double|decimal~', $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "")
                . (preg_match('~char|text|enum|set~', $field["type"]) && $field["collation"] ? " $collate '" . $mysql->escape_string($field["collation"]) . "'" : "")
        ;
index 4baa48487f02667c9a7e9e4f7ffcb6861cf112fc..264531d03e1b87d9eee3635c5967b427977bd3d5 100644 (file)
@@ -149,6 +149,11 @@ function where() {
        return $return;
 }
 
+function process_length($length) {
+       global $enum_length;
+       return (preg_match("~^\\s*(?:$enum_length)(?:\\s*,\\s*(?:$enum_length))*\\s*\$~", $length) && preg_match_all("~$enum_length~", $length, $matches) ? implode(",", $matches[0]) : preg_replace('~[^0-9,]~', '', $length));
+}
+
 function collations() {
        global $mysql;
        $return = array();