From: Bharat M. <bh...@us...> - 2001-07-30 16:58:55
|
Update of /cvsroot/gallery/gallery/classes/gallery In directory usw-pr-cvs1:/tmp/cvs-serv12163 Modified Files: UserDB.php Log Message: Fixed the UserDB upgrade/migration code. Index: UserDB.php =================================================================== RCS file: /cvsroot/gallery/gallery/classes/gallery/UserDB.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- UserDB.php 2001/07/30 08:00:59 1.1 +++ UserDB.php 2001/07/30 16:58:51 1.2 @@ -51,18 +51,16 @@ if (fs_file_exists("$userDir/userdb.dat")) { $tmp = getFile("$userDir/userdb.dat"); - $tmpclass = unserialize($tmp); /* * We moved from class UserDB.php to class Gallery_UserDB.php * in v1.2. If we're upgrading from an old version, just ignore * the old cache file (it'll get rebuilt automatically). */ - if (strcmp(get_class($tmpclass), "userdb")) { - $this = $tmpclass; - } + if (strcmp(substr($tmp, 0, 12), 'O:6:"userdb"')) { + $this = unserialize($tmp); + } } - if (!$this->nobody) { $this->nobody = new NobodyUser(); |