diff --git a/bbs/list.php b/bbs/list.php index 9c4897674..b35e28843 100644 --- a/bbs/list.php +++ b/bbs/list.php @@ -191,6 +191,9 @@ if (!$sst) { if(!$sst) $sst = "wr_num, wr_reply"; +// 정렬 방향 화이트리스트 +$sod = preg_match("/^(asc|desc)$/i", $sod) ? $sod : ''; + if ($sst) { $sql_order = " order by {$sst} {$sod} "; } diff --git a/mobile/shop/itemqalist.php b/mobile/shop/itemqalist.php index 99b4fc76d..7288832d7 100644 --- a/mobile/shop/itemqalist.php +++ b/mobile/shop/itemqalist.php @@ -36,6 +36,9 @@ if (!$sst) { $sst = "a.iq_id"; $sod = "desc"; } +// 정렬 컬럼/방향 화이트리스트 +$sst = in_array($sst, array('a.iq_id', 'a.iq_datetime', 'a.it_id', 'b.it_name'), true) ? $sst : 'a.iq_id'; +$sod = preg_match("/^(asc|desc)$/i", $sod) ? $sod : 'desc'; $sql_order = " order by $sst $sod "; $sql = " select count(*) as cnt diff --git a/mobile/shop/itemuselist.php b/mobile/shop/itemuselist.php index 0a017004c..1513d6f96 100644 --- a/mobile/shop/itemuselist.php +++ b/mobile/shop/itemuselist.php @@ -36,6 +36,9 @@ if (!$sst) { $sst = "a.is_id"; $sod = "desc"; } +// 정렬 컬럼/방향 화이트리스트 +$sst = in_array($sst, array('a.is_id', 'a.is_datetime', 'a.is_score', 'a.it_id', 'b.it_name'), true) ? $sst : 'a.is_id'; +$sod = preg_match("/^(asc|desc)$/i", $sod) ? $sod : 'desc'; $sql_order = " order by $sst $sod "; $sql = " select count(*) as cnt diff --git a/shop/itemqalist.php b/shop/itemqalist.php index a8bd8c735..d15c7b72f 100644 --- a/shop/itemqalist.php +++ b/shop/itemqalist.php @@ -41,6 +41,9 @@ if (!$sst) { $sst = "a.iq_id"; $sod = "desc"; } +// 정렬 컬럼/방향 화이트리스트 +$sst = in_array($sst, array('a.iq_id', 'a.iq_datetime', 'a.it_id', 'b.it_name'), true) ? $sst : 'a.iq_id'; +$sod = preg_match("/^(asc|desc)$/i", $sod) ? $sod : 'desc'; $sql_order = " order by $sst $sod "; $sql = " select count(*) as cnt diff --git a/shop/itemuselist.php b/shop/itemuselist.php index a4d2b43bd..aadc0ba15 100644 --- a/shop/itemuselist.php +++ b/shop/itemuselist.php @@ -41,6 +41,9 @@ if (!$sst) { $sst = "a.is_id"; $sod = "desc"; } +// 정렬 컬럼/방향 화이트리스트 +$sst = in_array($sst, array('a.is_id', 'a.is_datetime', 'a.is_score', 'a.it_id', 'b.it_name'), true) ? $sst : 'a.is_id'; +$sod = preg_match("/^(asc|desc)$/i", $sod) ? $sod : 'desc'; $sql_order = " order by $sst $sod "; $sql = " select count(*) as cnt