Changeset 18273
- Timestamp:
- 2009/09/01 12:31:58 (15 years ago)
- Location:
- branches/comu-ver2/data/class
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/helper/SC_Helper_DB.php
r18272 r18273 829 829 $category_id = (int) $category_id; 830 830 $product_id = (int) $product_id; 831 if (SC_Utils_Ex::sfIsInt($category_id)&& $this->sfIsRecord("dtb_category","category_id", $category_id)) {831 if (SC_Utils_Ex::sfIsInt($category_id) && $category_id != 0 && $this->sfIsRecord("dtb_category","category_id", $category_id)) { 832 832 $this->g_category_id = array($category_id); 833 } else if (SC_Utils_Ex::sfIsInt($product_id) && $ this->sfIsRecord("dtb_products","product_id", $product_id, $status)) {833 } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord("dtb_products","product_id", $product_id, $status)) { 834 834 $objQuery = new SC_Query(); 835 835 $where = "product_id = ?"; … … 1662 1662 } 1663 1663 1664 if (!$this->g_maker_on) {1664 if (!$this->g_maker_on) { 1665 1665 $this->g_maker_on = true; 1666 1666 $maker_id = (int) $maker_id; 1667 1667 $product_id = (int) $product_id; 1668 if (SC_Utils_Ex::sfIsInt($maker_id)&& $this->sfIsRecord("dtb_maker","maker_id", $maker_id)) {1668 if (SC_Utils_Ex::sfIsInt($maker_id) && $maker_id != 0 && $this->sfIsRecord("dtb_maker","maker_id", $maker_id)) { 1669 1669 $this->g_maker_id = array($maker_id); 1670 } else if (SC_Utils_Ex::sfIsInt($product_id) && $ this->sfIsRecord("dtb_products","product_id", $product_id, $status)) {1670 } else if (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord("dtb_products","product_id", $product_id, $status)) { 1671 1671 $objQuery = new SC_Query(); 1672 1672 $where = "product_id = ?"; -
branches/comu-ver2/data/class/util/SC_Utils.php
r18259 r18273 261 261 } 262 262 263 // INT型の数値チェック 263 /** 264 * INT型の数値チェック 265 * ・FIXME: マイナス値の扱いが不明確 266 * ・XXX: INT_LENには収まるが、INT型の範囲を超えるケースに対応できないのでは? 267 * 268 * @param mixed $value 269 * @return bool 270 */ 271 // 264 272 function sfIsInt($value) { 265 if ($value != ""&& strlen($value) <= INT_LEN && is_numeric($value)) {273 if (strlen($value) >= 1 && strlen($value) <= INT_LEN && is_numeric($value)) { 266 274 return true; 267 275 }
Note: See TracChangeset
for help on using the changeset viewer.