Skip to content

Commit 1427a3f

Browse files
committed
Fix update proccess for PunBB 1.4
1 parent 1b97dfd commit 1427a3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

admin/db_update.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
error('Version mismatch. The database \''.$db_name.'\' doesn\'t seem to be running a PunBB database schema supported by this update script.', __FILE__, __LINE__);
102102

103103
// If we've already done charset conversion in a previous update, we have to do SET NAMES
104-
$forum_db->set_names(strpos($cur_version, '1.3') === 0 ? 'utf8' : 'latin1');
104+
$forum_db->set_names(version_compare($cur_version, '1.3', '>=') ? 'utf8' : 'latin1');
105105

106106
// If MySQL, make sure it's at least 4.1.2
107107
if (in_array($db_type, array('mysql', 'mysqli', 'mysql_innodb', 'mysqli_innodb')))
@@ -1379,7 +1379,7 @@ function convert_avatars()
13791379

13801380

13811381
// Should we do charset conversion or not?
1382-
if (strpos($cur_version, '1.3') === 0)
1382+
if (version_compare($cur_version, '1.3', '>='))
13831383
$query_str = '?stage=finish';
13841384
elseif (strpos($cur_version, '1.2') === 0 && isset($_GET['convert_charset']))
13851385
$query_str = '?stage=conv_misc&req_old_charset='.$old_charset.'&req_per_page='.PER_PAGE;

0 commit comments

Comments
 (0)