'null === ...' can be used.

(cherry picked from commit ec96f65)
This commit is contained in:
Yuriy Pikhtarev 2017-05-05 00:59:05 +03:00 committed by Vasily Komrakov
commit 64df3c5538
No known key found for this signature in database
GPG key ID: 558236680C20A69A
8 changed files with 47 additions and 47 deletions

View file

@ -332,7 +332,7 @@ if ($tor_reged && $tor_info) {
$sp_up_tot[$x] += $peer['speed_up'];
$sp_down_tot[$x] += $peer['speed_down'];
$guest = ($peer['user_id'] == GUEST_UID || is_null($peer['username']));
$guest = ($peer['user_id'] == GUEST_UID || null === $peer['username']);
$p_max_up = $peer['uploaded'];
$p_max_down = $peer['downloaded'];

View file

@ -567,7 +567,7 @@ function attach_mod_sql_build_array($query, $assoc_ary = false)
foreach ($assoc_ary as $key => $var) {
$fields[] = $key;
if (is_null($var)) {
if (null === $var) {
$values[] = 'NULL';
} elseif (is_string($var)) {
$values[] = "'" . attach_mod_sql_escape($var) . "'";
@ -584,7 +584,7 @@ function attach_mod_sql_build_array($query, $assoc_ary = false)
foreach ($assoc_ary as $id => $sql_ary) {
$values = array();
foreach ($sql_ary as $key => $var) {
if (is_null($var)) {
if (null === $var) {
$values[] = 'NULL';
} elseif (is_string($var)) {
$values[] = "'" . attach_mod_sql_escape($var) . "'";
@ -599,7 +599,7 @@ function attach_mod_sql_build_array($query, $assoc_ary = false)
} elseif ($query == 'UPDATE' || $query == 'SELECT') {
$values = array();
foreach ($assoc_ary as $key => $var) {
if (is_null($var)) {
if (null === $var) {
$values[] = "$key = NULL";
} elseif (is_string($var)) {
$values[] = "$key = '" . attach_mod_sql_escape($var) . "'";