Questions about this topic? Sign up to ask in the talk tab.
Difference between revisions of "Mass Assignment"
From NetSec
Line 1: | Line 1: | ||
− | |||
== [[Ruby]] == | == [[Ruby]] == | ||
Typically used in [[Ruby on Rails]], sometimes people will use the following code to create an ActiveRecord object to add a [[database]] entry: | Typically used in [[Ruby on Rails]], sometimes people will use the following code to create an ActiveRecord object to add a [[database]] entry: | ||
Line 20: | Line 19: | ||
?> | ?> | ||
</source>}} | </source>}} | ||
− | + | {{programming}} | |
{{expand}} | {{expand}} |
Revision as of 03:34, 22 October 2012
Ruby
Typically used in Ruby on Rails, sometimes people will use the following code to create an ActiveRecord object to add a database entry:
<syntaxhighlight lang=ruby> @user=User.new(params[:user]) </syntaxhighlight> |
There have been problems with RoR in the past with mass assignment.
PHP
<?php $object = new object(); foreach ($_REQUEST as $property => $value) { $object->$property = $value; } ?> |
Mass Assignment is part of a series on programming.
This article contains too little information, it should be expanded or updated. |
---|
Things you can do to help:
|