diff -urN punbb-1.2.21/upload/admin_index.php punbb-1.2.22/upload/admin_index.php --- punbb-1.2.21/upload/admin_index.php 2008-10-23 07:49:10.000000000 +0000 +++ punbb-1.2.22/upload/admin_index.php 2009-04-20 07:46:13.000000000 +0000 @@ -50,13 +50,10 @@ if ($latest_version == '') message('Check for upgrade failed for unknown reasons.'); - $cur_version = str_replace(array('.', 'dev', 'beta', ' '), '', strtolower($pun_config['o_cur_version'])); - $cur_version = (strlen($cur_version) == 2) ? intval($cur_version) * 10 : intval($cur_version); + $latest_version = preg_replace('/(\.0)+(?!\.)|(\.0+$)/', '$2', $latest_version); + $cur_version = preg_replace('/(\.0)+(?!\.)|(\.0+$)/', '$2', $cur_version); - $latest_version = str_replace('.', '', strtolower($latest_version)); - $latest_version = (strlen($latest_version) == 2) ? intval($latest_version) * 10 : intval($latest_version); - - if ($cur_version >= $latest_version) + if (version_compare($cur_version, $latest_version, '>=')) message('You are running the latest version of PunBB.'); else message('A new version of PunBB has been released. You can download the latest version at PunBB.Informer.Com.'); diff -urN punbb-1.2.21/upload/admin_prune.php punbb-1.2.22/upload/admin_prune.php --- punbb-1.2.21/upload/admin_prune.php 2008-10-23 07:49:10.000000000 +0000 +++ punbb-1.2.22/upload/admin_prune.php 2009-09-01 07:27:43.000000000 +0000 @@ -42,6 +42,7 @@ confirm_referrer('admin_prune.php'); $prune_from = $_POST['prune_from']; + $prune_sticky = isset($_POST['prune_sticky']) ? '1' : '0'; $prune_days = intval($_POST['prune_days']); $prune_date = ($prune_days) ? time() - ($prune_days*86400) : -1; @@ -56,14 +57,14 @@ { $fid = $db->result($result, $i); - prune($fid, $_POST['prune_sticky'], $prune_date); + prune($fid, $prune_sticky, $prune_date); update_forum($fid); } } else { $prune_from = intval($prune_from); - prune($prune_from, $_POST['prune_sticky'], $prune_date); + prune($prune_from, $prune_sticky, $prune_date); update_forum($prune_from); } @@ -93,7 +94,7 @@ // Concatenate together the query for counting number or topics to prune $sql = 'SELECT COUNT(id) FROM '.$db->prefix.'topics WHERE last_post<'.$prune_date.' AND moved_to IS NULL'; - if ($_POST['prune_sticky'] == '0') + if (!$prune_sticky) $sql .= ' AND sticky=\'0\''; if ($prune_from != 'all') @@ -127,7 +128,7 @@