<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: 你的 CakePHP 应用安全吗？</title>
	<link>http://nio.infor96.com/archives/754</link>
	<description>Coding Life</description>
	<pubDate>Mon, 13 Oct 2008 04:21:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1</generator>

	<item>
		<title>By: 老王</title>
		<link>http://nio.infor96.com/archives/754#comment-33755</link>
		<author>老王</author>
		<pubDate>Thu, 13 Sep 2007 02:46:30 +0000</pubDate>
		<guid>http://nio.infor96.com/archives/754#comment-33755</guid>
					<description>model中save方法的第三个参数就是干这个的：
/**
 * Saves model data to the database.
 * By default, validation occurs before save.
 *
 * @param array $data Data to save.
 * @param boolean $validate If set, validation will be done before the save
 * @param array $fieldList List of fields to allow to be written
 * @return boolean success
 */
	function save($data = null, $validate = true, $fieldList = array())</description>
		<content:encoded><![CDATA[<p>model中save方法的第三个参数就是干这个的：<br />
/**<br />
 * Saves model data to the database.<br />
 * By default, validation occurs before save.<br />
 *<br />
 * @param array $data Data to save.<br />
 * @param boolean $validate If set, validation will be done before the save<br />
 * @param array $fieldList List of fields to allow to be written<br />
 * @return boolean success<br />
 */<br />
	function save($data = null, $validate = true, $fieldList = array())</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: Nio</title>
		<link>http://nio.infor96.com/archives/754#comment-33762</link>
		<author>Nio</author>
		<pubDate>Thu, 13 Sep 2007 07:17:08 +0000</pubDate>
		<guid>http://nio.infor96.com/archives/754#comment-33762</guid>
					<description>to 老王：这第三个参数对 id 起不到过滤作用的，因为 id 在 $this-&gt;set($data);（save() 方法中）的时候就被设置到 Model::$id 属性中的，而这个 id 恰恰被用于判断是 update 还是 create。你可以在表单中加入一个 hidden 的 id 字段，指向已存在的记录，测试一下就一目了然了。</description>
		<content:encoded><![CDATA[<p>to 老王：这第三个参数对 id 起不到过滤作用的，因为 id 在 $this->set($data);（save() 方法中）的时候就被设置到 Model::$id 属性中的，而这个 id 恰恰被用于判断是 update 还是 create。你可以在表单中加入一个 hidden 的 id 字段，指向已存在的记录，测试一下就一目了然了。</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: 老王</title>
		<link>http://nio.infor96.com/archives/754#comment-33768</link>
		<author>老王</author>
		<pubDate>Thu, 13 Sep 2007 08:58:18 +0000</pubDate>
		<guid>http://nio.infor96.com/archives/754#comment-33768</guid>
					<description>看了一下cake的源代码，还真是这样，save之前调用create形同虚设，看来这个cake的一个bug，不应该允许id随便设置。</description>
		<content:encoded><![CDATA[<p>看了一下cake的源代码，还真是这样，save之前调用create形同虚设，看来这个cake的一个bug，不应该允许id随便设置。</p>
]]></content:encoded>
				</item>
</channel>
</rss>
