English 中文(简体)
是否发现(a) 方法使投入具有活力?
原标题:Does find() method sanitize input?
  • 时间:2011-11-17 16:53:40
  •  标签:
  • cakephp

鉴于以下控制器方法,我是否有必要使<条码>(过滤<>/条码>)制度化。 或者对我来说,这样做会失败吗? 如果是的话, c是否具备这方面的职能?

function ajax_load_games($filtro, $console_id){         
    $this->set( game , 
        $this->Game->find( all ,
            array( conditions  => array( Game.game_name LIKE  => "%$filtro%"))
        )
    );
}
最佳回答

I wouldnt call it sanitizing but escaping. it will be done automatically for all find operations if you use the basic wrappers (not query() directly).

Also note: It is done on basic save operations, as well: saveField, save, saveAll.

但是,对于询问或删除,你没有保护。 所有人,更新者等!

问题回答

如果你使用适当的阵列通知,则电离层法则适用于防止在<条码>、条码>、条码和<条码>中投射(即你可能意味着的)。

它这样说:





相关问题
PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

specifying date format when using $form->inputs() in CakePHP

I am wondering if there is a way to specify the date format in the forms created using CakePHP s $form->inputs(); Please note that this is not the individual $form->input() but instead $form->inputs() ...

Using DISTINCT in a CakePHP find function

I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter ...

Assistance with CakePHP model relationships

How would I represent the following in a CakePHP model? Product ======= product_id .... Cart ==== cart_id .... Carts_Products ============== cart_id product_id quantity

Prevent controller from trying to autoload model

I am a beginning Cake user and trying to do some work on an already existing application. Running into a problem when I create a new controller. I have created StoreController and when I try to call ...

热门标签