diff --git a/adm/admin.lib.php b/adm/admin.lib.php
index a3ca32f19..d4bb2cb81 100644
--- a/adm/admin.lib.php
+++ b/adm/admin.lib.php
@@ -260,11 +260,11 @@ while ($entry = $tmp->read()) {
}
@ksort($amenu);
-$qstr = '';
-if (isset($sst)) $qstr .= '&sst='.$sst;
-if (isset($sod)) $qstr .= '&sod='.$sod;
-if (isset($sfl)) $qstr .= '&sfl='.$sfl;
-if (isset($stx)) $qstr .= '&stx='.$stx;
-if (isset($page)) $qstr .= '&page='.$page;
-//$qstr = 'sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page';
+$arr_query = array();
+if (isset($sst)) $arr_query[] = 'sst='.$sst;
+if (isset($sod)) $arr_query[] = 'sod='.$sod;
+if (isset($sfl)) $arr_query[] = 'sfl='.$sfl;
+if (isset($stx)) $arr_query[] = 'stx='.$stx;
+if (isset($page)) $arr_query[] = 'page='.$page;
+$qstr = implode("&", $arr_query);
?>
\ No newline at end of file
diff --git a/lib/common.lib.php b/lib/common.lib.php
index 0351b0c95..65c195451 100644
--- a/lib/common.lib.php
+++ b/lib/common.lib.php
@@ -18,7 +18,7 @@ function get_microtime()
// 현재페이지, 총페이지수, 한페이지에 보여줄 행, URL
function get_paging($write_pages, $cur_page, $total_page, $url, $add="")
{
- $url = preg_replace('#(&|&)?page\=[0-9]+#', '', $url);
+ $url = preg_replace('#&page=[0-9]*(&page=)$#', '$1', $url);
$str = '';
if ($cur_page > 1) {
@@ -748,7 +748,15 @@ function subject_sort_link($col, $query_string='', $flag='asc')
}
}
- return '';
+ $arr_query = array();
+ $arr_query[] = $q1;
+ $arr_query[] = $q2;
+ $arr_query[] = 'sfl='.$sfl;
+ $arr_query[] = 'stx='.$stx;
+ $arr_query[] = 'page='.$page;
+ $qstr = implode("&", $arr_query);
+
+ return "";
}
diff --git a/test.php b/test.php
index c276d6d96..26cf6e554 100644
--- a/test.php
+++ b/test.php
@@ -1,24 +1,8 @@
-
-
-
-title
-
-
-
-
+
+$qstr1 = "&stx=ddd&page=123";
+$qstr2 = "&stx=ddd&page=123&";
+$qstr3 = "&stx=ddd&page=&";
+$qstr3 = "&stx=ddd&page=x&";
-이 문자열에서 부분을 치환합니다.
-
-치환하기
-
-
-
-
-
-
\ No newline at end of file
+echo preg_replace('#(&|&)?page\=[^&]*#', '', $qstr3);
+?>
\ No newline at end of file