diff --git a/e107_handlers/db_verify_class.php b/e107_handlers/db_verify_class.php index 97af62019..4678ea2b0 100755 --- a/e107_handlers/db_verify_class.php +++ b/e107_handlers/db_verify_class.php @@ -952,9 +952,9 @@ class db_verify foreach($tmp as $line) { $line = trim($line); - $newline[] = preg_replace("/^([^`A-Z\s][a-z_]*)/","`$1`", $line); + $newline[] = preg_replace("/^([^`A-Z\s][a-z_]*[0-9]?)/","`$1`", $line); } - + $data = implode("\n",$newline); // -------------------- @@ -966,6 +966,7 @@ class db_verify if(e_DEBUG) { // e107::getMessage()->addDebug("Regex: ".print_a($data,true)); + // echo $regex; // e107::getMessage()->addDebug("Regex: ".$regex); } diff --git a/e107_tests/tests/unit/db_verifyTest.php b/e107_tests/tests/unit/db_verifyTest.php index 116719f0c..ecce2a5db 100644 --- a/e107_tests/tests/unit/db_verifyTest.php +++ b/e107_tests/tests/unit/db_verifyTest.php @@ -48,6 +48,7 @@ table_description text, table_summary text, table_media text, + table_email2 tinyint(3) unsigned NOT NULL default '0', PRIMARY KEY (table_id)"; $expected = array ( @@ -179,6 +180,14 @@ 'null' => '', 'default' => '', ), + 'table_email2' => + array ( + 'type' => 'TINYINT', + 'value' => '3', + 'attributes' => 'UNSIGNED', + 'null' => 'NOT NULL', + 'default' => 'DEFAULT \'0\'', + ), ); $actual = $this->dbv->getFields($data); @@ -528,7 +537,8 @@ PRIMARY KEY (rate_id) ) ENGINE=MyISAM; - " + ", + ); $expected = array(