Ignore:
Timestamp:
2009/09/01 12:31:58 (17 years ago)
Author:
Seasoft
Message:

SC_Utils#sfIsInt の改修。

  • 「0」をINT型でないと見なしてしまうバグを修正。
  • 他の問題点をコメントに記述。
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/helper/SC_Helper_DB.php

    r18272 r18273  
    829829            $category_id = (int) $category_id; 
    830830            $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)) { 
    832832                $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)) { 
    834834                $objQuery = new SC_Query(); 
    835835                $where = "product_id = ?"; 
     
    16621662        } 
    16631663 
    1664         if(!$this->g_maker_on) { 
     1664        if (!$this->g_maker_on) { 
    16651665            $this->g_maker_on = true; 
    16661666            $maker_id = (int) $maker_id; 
    16671667            $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)) { 
    16691669                $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)) { 
    16711671                $objQuery = new SC_Query(); 
    16721672                $where = "product_id = ?"; 
Note: See TracChangeset for help on using the changeset viewer.