]> git.joonet.de Git - adminer.git/commitdiff
Function process_length used only in Adminer
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 27 Jul 2009 15:31:11 +0000 (15:31 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Mon, 27 Jul 2009 15:31:11 +0000 (15:31 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@916 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/include/bootstrap.inc.php
adminer/include/editing.inc.php
adminer/include/functions.inc.php
adminer/index.php

index 15f212c27cd3405b1de09275390c9b0d2d2bdae0..5aa4a932489125483d95b5a433f6720d8970cae2 100644 (file)
@@ -82,7 +82,6 @@ include "./include/editing.inc.php";
 include "./include/export.inc.php";
 
 $confirm = " onclick=\"return confirm('" . lang('Are you sure?') . "');\"";
-$enum_length = '\'(?:\'\'|[^\'\\\\]+|\\\\.)*\'|"(?:""|[^"\\\\]+|\\\\.)*"';
 $token = $_SESSION["tokens"][$_GET["server"]];
 $error = ($_POST
        ? ($_POST["token"] == $token ? "" : lang('Invalid CSRF token. Send the form again.'))
index 948461e23c83360304e201b662e6c897548afc99..9202a43e831a02b86f397afb0511aac3edf29062 100644 (file)
@@ -29,6 +29,11 @@ echo ($unsigned ? " <select name=\"$key" . '[unsigned]"' . (!$field["type"] || e
 <?php
 }
 
+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 process_type($field, $collate = "COLLATE") {
        global $dbh, $enum_length, $unsigned;
        return " $field[type]"
index 3228b63fa9432f75bb10fcc3573feefb3eeb1535..674f4ce550741f3d64306dbf8f8a58d26a47ae39 100644 (file)
@@ -97,11 +97,6 @@ function where_link($i, $column, $value) {
        return "&amp;where%5B$i%5D%5Bcol%5D=" . urlencode($column) . "&amp;where%5B$i%5D%5Bop%5D=%3D&amp;where%5B$i%5D%5Bval%5D=" . urlencode($value);
 }
 
-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 redirect($location, $message = null) {
        if (isset($message)) {
                $_SESSION["messages"][] = $message;
index 73a96b23a7acaebca5c0dd54a8a0de1fc9cf5f90..3e445478f169badf7891196c478e4848a7e9f787 100644 (file)
@@ -8,6 +8,7 @@
 
 include "./include/bootstrap.inc.php";
 
+$enum_length = '\'(?:\'\'|[^\'\\\\]+|\\\\.)*\'|"(?:""|[^"\\\\]+|\\\\.)*"';
 $inout = array("IN", "OUT", "INOUT");
 
 if (isset($_GET["download"])) {