Commit 61b174e7 authored by Steven Wittens's avatar Steven Wittens
Browse files

#11548: node.module - Ensure that only valid fields are saved

parent 59558ede
...@@ -444,7 +444,7 @@ function node_save($node) { ...@@ -444,7 +444,7 @@ function node_save($node) {
// Prepare the query: // Prepare the query:
foreach ($node as $key => $value) { foreach ($node as $key => $value) {
if (in_array($key, $fields)) { if (in_array((string) $key, $fields)) {
$k[] = db_escape_string($key); $k[] = db_escape_string($key);
$v[] = $value; $v[] = $value;
$s[] = "'%s'"; $s[] = "'%s'";
......
...@@ -444,7 +444,7 @@ function node_save($node) { ...@@ -444,7 +444,7 @@ function node_save($node) {
// Prepare the query: // Prepare the query:
foreach ($node as $key => $value) { foreach ($node as $key => $value) {
if (in_array($key, $fields)) { if (in_array((string) $key, $fields)) {
$k[] = db_escape_string($key); $k[] = db_escape_string($key);
$v[] = $value; $v[] = $value;
$s[] = "'%s'"; $s[] = "'%s'";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment