1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-31 11:39:37 +02:00

[feature/sqlite3] Remove trailing comma from column list

PHPBB3-9728
This commit is contained in:
Joas Schilling 2014-04-28 21:47:55 +02:00
parent 8c2b80e3d2
commit 07042e484e

View File

@ -2006,7 +2006,12 @@ class tools
$columns = implode(',', $column_list);
$new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols);
$new_table_cols = trim(preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols));
if (substr($new_table_cols, -1) === ',')
{
// Remove the comma from the last entry again
$new_table_cols = substr($new_table_cols, 0, -1);
}
// create a new table and fill it up. destroy the temp one
$statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');';