aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2006-05-23 21:15:34 +0000
committerplegall <plg@piwigo.org>2006-05-23 21:15:34 +0000
commit91642e86831e090615fa1e25058e692b33a0768d (patch)
tree2da97fe870414e9cf4e83d4ce8940f206d53f50a
parent58bce5eb42264a7b83934800be9ef7d62e5a334e (diff)
bug fixed: many errors reported if your database contains something else
than PhpWebGallery tables. git-svn-id: http://piwigo.org/svn/branches/branch-1_6@1319 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--upgrade.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/upgrade.php b/upgrade.php
index ae553dc3e..c2a68a920 100644
--- a/upgrade.php
+++ b/upgrade.php
@@ -81,10 +81,10 @@ SHOW TABLES
while ($row = mysql_fetch_row($result))
{
- array_push(
- $tables,
- preg_replace('/^'.PREFIX_TABLE.'/', '', $row[0])
- );
+ if (preg_match('/^'.PREFIX_TABLE.'/', $row[0]))
+ {
+ array_push($tables, $row[0]);
+ }
}
return $tables;
@@ -102,7 +102,7 @@ function get_columns_of($tables)
foreach ($tables as $table)
{
$query = '
-DESC '.PREFIX_TABLE.$table.'
+DESC '.$table.'
;';
$result = mysql_query($query);
@@ -161,10 +161,10 @@ if (!isset($_GET['version']))
$tables = get_tables();
$columns_of = get_columns_of($tables);
- if (!in_array('param', $columns_of['config']))
+ if (!in_array('param', $columns_of[PREFIX_TABLE.'config']))
{
// we're in branch 1.3, important upgrade, isn't it?
- if (in_array('user_category', $tables))
+ if (in_array(PREFIX_TABLE.'user_category', $tables))
{
$current_release = '1.3.1';
}
@@ -173,11 +173,11 @@ if (!isset($_GET['version']))
$current_release = '1.3.0';
}
}
- else if (!in_array('user_cache', $tables))
+ else if (!in_array(PREFIX_TABLE.'user_cache', $tables))
{
$current_release = '1.4.0';
}
- else if (!in_array('tags', $tables))
+ else if (!in_array(PREFIX_TABLE.'tags', $tables))
{
$current_release = '1.5.0';
}
@@ -302,4 +302,4 @@ UPDATE '.USER_CACHE_TABLE.'
// +-----------------------------------------------------------------------+
$template->pparse('upgrade');
-?> \ No newline at end of file
+?>