diff options
author | natrak <> | 2001-05-23 18:36:12 +0000 |
---|---|---|
committer | natrak <> | 2001-05-23 18:36:12 +0000 |
commit | 886f653e21c4ea084103c2471e5410bc17d09d7d (patch) | |
tree | 5ab35f495bdce0a1dedc009533c9551b9d528547 | |
parent | a28bf8f399beb290668370e93e9b35b457ff7134 (diff) | |
download | brdo-886f653e21c4ea084103c2471e5410bc17d09d7d.tar.gz brdo-886f653e21c4ea084103c2471e5410bc17d09d7d.tar.bz2 |
- Fixed a "bug" with in_array. Behaves strangely when the key is of type long.
When $field was 0 it would return true, causing SQL errors. Seems to
convert the string its being matched with to a numeric, normally 0. Forced
$field to be treated as a string by enclosing it in quotes.
-rw-r--r-- | includes/node.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/includes/node.inc b/includes/node.inc index 9f4429c3f..0be42e890 100644 --- a/includes/node.inc +++ b/includes/node.inc @@ -74,8 +74,8 @@ function node_save($node, $filter) { $u2 = array(); foreach ($node as $field=>$value) { - if (in_array($field, $filter)) { - if (in_array($field, $rows)) { + if (in_array("$field", $filter)) { + if (in_array("$field", $rows)) { array_push($u1, check_input($field) ." = '". check_input($value) ."'"); } else { |