1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Fixes #4155 - database verification was failing when field name ended in a digit.

This commit is contained in:
Cameron 2020-05-16 13:14:29 -07:00
parent 7081737f12
commit 1f502ce459
2 changed files with 14 additions and 3 deletions

View File

@ -952,9 +952,9 @@ class db_verify
foreach($tmp as $line) foreach($tmp as $line)
{ {
$line = trim($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); $data = implode("\n",$newline);
// -------------------- // --------------------
@ -966,6 +966,7 @@ class db_verify
if(e_DEBUG) if(e_DEBUG)
{ {
// e107::getMessage()->addDebug("Regex: ".print_a($data,true)); // e107::getMessage()->addDebug("Regex: ".print_a($data,true));
// echo $regex;
// e107::getMessage()->addDebug("Regex: ".$regex); // e107::getMessage()->addDebug("Regex: ".$regex);
} }

View File

@ -48,6 +48,7 @@
table_description text, table_description text,
table_summary text, table_summary text,
table_media text, table_media text,
table_email2 tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (table_id)"; PRIMARY KEY (table_id)";
$expected = array ( $expected = array (
@ -179,6 +180,14 @@
'null' => '', 'null' => '',
'default' => '', 'default' => '',
), ),
'table_email2' =>
array (
'type' => 'TINYINT',
'value' => '3',
'attributes' => 'UNSIGNED',
'null' => 'NOT NULL',
'default' => 'DEFAULT \'0\'',
),
); );
$actual = $this->dbv->getFields($data); $actual = $this->dbv->getFields($data);
@ -528,7 +537,8 @@
PRIMARY KEY (rate_id) PRIMARY KEY (rate_id)
) ENGINE=MyISAM; ) ENGINE=MyISAM;
" ",
); );
$expected = array( $expected = array(