diff options
author | plegall <plg@piwigo.org> | 2006-07-03 22:53:26 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2006-07-03 22:53:26 +0000 |
commit | 4ce94a5eabae23a48bdd889aebefd26ddea51f1f (patch) | |
tree | f19a8f11ed360c6d435e2fa3492aa00b983fc6c6 | |
parent | aa2c4ef173b7a38ce727aab9818b370e26742e4a (diff) |
merge -r1426:1427 from branch 1.6 to trunk (bug 397 fixed: [...] type
comparison with operator "==").
git-svn-id: http://piwigo.org/svn/trunk@1428 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | admin/include/functions.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php index da21be52c..47745a5a7 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -607,7 +607,7 @@ INSERT INTO '.$table_name.' $query.= ','; } - if (!isset($insert[$dbfield]) or $insert[$dbfield] == '') + if (!isset($insert[$dbfield]) or $insert[$dbfield] === '') { $query.= 'NULL'; } @@ -940,14 +940,24 @@ SELECT image_id LIMIT 0,1 ;'; list($representative) = mysql_fetch_array(pwg_query($query)); - $data = array('id' => $category_id, - 'representative_picture_id' => $representative); - array_push($datas, $data); + + array_push( + $datas, + array( + 'id' => $category_id, + 'representative_picture_id' => $representative, + ) + ); } - $fields = array('primary' => array('id'), - 'update' => array('representative_picture_id')); - mass_updates(CATEGORIES_TABLE, $fields, $datas); + mass_updates( + CATEGORIES_TABLE, + array( + 'primary' => array('id'), + 'update' => array('representative_picture_id') + ), + $datas + ); } /** |