>From 35185b36a74914c86750ca383ad7cc320168048a Mon Sep 17 00:00:00 2001
From: Loui Chang <louipc.ist@gmail.com>
Date: Tue, 18 Mar 2008 00:06:16 -0400
Subject: [PATCH] Fix package search browsing bug caused by commit 1fd908d...

Signed-off-by: Loui Chang <louipc.ist@gmail.com>

---
 web/lib/pkgfuncs.inc |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index 0b31618..5164484 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -621,23 +621,30 @@ function pkg_search_page($SID="") {
 		# reset the offset to zero if they hit Go
 		#
 		$_REQUEST["do_MyPackages"] = 0;
-		$_REQUEST["do_Orphans"] = 0;
+		unset($_REQUEST['do_Orphans']);
 		$O = 0;
 	}
 	if ($_REQUEST["do_MyPackages"] && $_REQUEST["do_MyPackages"] != 1) {
 		# reset the offset to zero if they hit My Packages
 		#
 		$_REQUEST["do_Search"] = 0;
-		$_REQUEST["do_Orphans"] = 0;
+		unset($_REQUEST['do_Orphans']);
 		$O = 0;
 	}
-	if (!empty($_REQUEST['do_Orphans']) && $_REQUEST['do_Orphans'] != 1) {
-		# reset the offset to zero if they hit Orphans
-		#
-		$_REQUEST["do_Search"] = 0;
-		$_REQUEST["do_MyPackages"] = 0;
-		$O = 0;
+
+	if (!empty($_REQUEST['do_Orphans'])) {
+		if( $_REQUEST['do_Orphans'] != 1) {
+			# reset the offset to zero if they hit Orphans
+			#
+			$_REQUEST['do_Search'] = 0;
+			$_REQUEST['do_MyPackages'] = 0;
+			$O = 0;
+		}
 	}
+	else {
+		unset($_REQUEST['do_Orphans']);
+	}
+
 	$_REQUEST["O"] = $O; # so that pkg_search_results() works
 
 
-- 
1.5.4.2

