Skip to content
Snippets Groups Projects
Commit 886f653e authored by natrak's avatar natrak
Browse files

- 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.
parent a28bf8f3
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment