aboutsummaryrefslogtreecommitdiffstats
path: root/admin/update.php
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2003-09-20 21:43:39 +0000
committerz0rglub <z0rglub@piwigo.org>2003-09-20 21:43:39 +0000
commite1f207136e67cb4bfd9114ebdba6a591187f408e (patch)
treea2faeeaa356b0b954a505368e16f2c816c4d7aff /admin/update.php
parent355bdf46c1186afbd4196121da919be2cf0a504e (diff)
If a category with a wrong directory name (accentuated characters) even
exists (from a previous release of PhpWebGallery), a warning message is displayed but the update goes on git-svn-id: http://piwigo.org/svn/trunk@147 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/update.php')
-rw-r--r--admin/update.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/admin/update.php b/admin/update.php
index ae5e32a66..56f96e336 100644
--- a/admin/update.php
+++ b/admin/update.php
@@ -86,6 +86,21 @@ function insert_local_category( $cat_id )
{
$output.= '<span style="color:red;">"'.$file.'" : ';
$output.= $lang['update_wrong_dirname'].'</span><br />';
+ // if the category even exists (from a previous release of
+ // PhpWebGallery), we keep it in our $subdirs array
+ $query = 'SELECT id';
+ $query.= ' FROM '.PREFIX_TABLE.'categories';
+ $query.= ' WHERE site_id = '.$site_id;
+ $query.= " AND dir = '".$file."'";
+ $query.= ' AND id_uppercat';
+ if ( !is_numeric( $cat_id ) ) $query.= ' IS NULL';
+ else $query.= ' = '.$cat_id;
+ $query.= ';';
+ $result = mysql_query( $query );
+ if ( mysql_num_rows( $result ) != 0 )
+ {
+ array_push( $subdirs, $file );
+ }
}
}
}