diff -urN punbb-1.2.19/upload/install.php punbb-1.2.20/upload/install.php
--- punbb-1.2.19/upload/install.php	2008-07-14 11:03:48.000000000 +0000
+++ punbb-1.2.20/upload/install.php	2008-08-20 07:59:29.000000000 +0000
@@ -24,7 +24,7 @@
 
 
 // The PunBB version this script installs
-$punbb_version = '1.2.19';
+$punbb_version = '1.2.20';
 
 
 define('PUN_ROOT', './');
diff -urN punbb-1.2.19/upload/moderate.php punbb-1.2.20/upload/moderate.php
--- punbb-1.2.19/upload/moderate.php	2008-07-11 09:26:07.000000000 +0000
+++ punbb-1.2.20/upload/moderate.php	2008-08-20 07:29:42.000000000 +0000
@@ -170,7 +170,7 @@
 	// Determine the post offset (based on $_GET['p'])
 	$num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
 
-	$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+	$p = (!isset($_GET['p']) || !is_numeric($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 	$start_from = $pun_user['disp_posts'] * ($p - 1);
 
 	// Generate paging links
@@ -566,7 +566,7 @@
 // Determine the topic offset (based on $_GET['p'])
 $num_pages = ceil($cur_forum['num_topics'] / $pun_user['disp_topics']);
 
-$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+$p = (!isset($_GET['p']) || !is_numeric($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 $start_from = $pun_user['disp_topics'] * ($p - 1);
 
 // Generate paging links
diff -urN punbb-1.2.19/upload/search.php punbb-1.2.20/upload/search.php
--- punbb-1.2.19/upload/search.php	2008-07-11 09:14:40.000000000 +0000
+++ punbb-1.2.20/upload/search.php	2008-08-20 07:29:42.000000000 +0000
@@ -466,7 +466,7 @@
 		$per_page = ($show_as == 'posts') ? $pun_user['disp_posts'] : $pun_user['disp_topics'];
 		$num_pages = ceil($num_hits / $per_page);
 
-		$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+		$p = (!isset($_GET['p']) || !is_numeric($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 		$start_from = $per_page * ($p - 1);
 
 		// Generate paging links
diff -urN punbb-1.2.19/upload/userlist.php punbb-1.2.20/upload/userlist.php
--- punbb-1.2.19/upload/userlist.php	2008-07-11 09:26:07.000000000 +0000
+++ punbb-1.2.20/upload/userlist.php	2008-08-20 07:29:42.000000000 +0000
@@ -125,7 +125,7 @@
 // Determine the user offset (based on $_GET['p'])
 $num_pages = ceil($num_users / 50);
 
-$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+$p = (!isset($_GET['p']) || !is_numeric($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 $start_from = 50 * ($p - 1);
 
 // Generate paging links
diff -urN punbb-1.2.19/upload/viewforum.php punbb-1.2.20/upload/viewforum.php
--- punbb-1.2.19/upload/viewforum.php	2008-07-11 09:14:40.000000000 +0000
+++ punbb-1.2.20/upload/viewforum.php	2008-08-20 07:29:42.000000000 +0000
@@ -69,7 +69,7 @@
 // Determine the topic offset (based on $_GET['p'])
 $num_pages = ceil($cur_forum['num_topics'] / $pun_user['disp_topics']);
 
-$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+$p = (!isset($_GET['p']) || !is_numeric($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
 $start_from = $pun_user['disp_topics'] * ($p - 1);
 
 // Generate paging links
@@ -253,4 +253,3 @@
 $forum_id = $id;
 $footer_style = 'viewforum';
 require PUN_ROOT.'footer.php';
-
diff -urN punbb-1.2.19/upload/viewtopic.php punbb-1.2.20/upload/viewtopic.php
--- punbb-1.2.19/upload/viewtopic.php	2008-07-11 09:14:40.000000000 +0000
+++ punbb-1.2.20/upload/viewtopic.php	2008-08-20 07:29:42.000000000 +0000
@@ -128,7 +128,8 @@
 // Determine the post offset (based on $_GET['p'])
 $num_pages = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
 
-$p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+$p = (!isset($_GET['p']) || !is_numeric($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
+
 $start_from = $pun_user['disp_posts'] * ($p - 1);
 
 // Generate paging links
