diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php index 0ea7233768..3ee42a531c 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldInt.php @@ -11,7 +11,7 @@ final class PhabricatorStandardCustomFieldInt $indexes = array(); $value = $this->getFieldValue(); - if (strlen($value)) { + if (phutil_nonempty_scalar($value)) { $indexes[] = $this->newNumericIndex((int)$value); } @@ -53,7 +53,7 @@ final class PhabricatorStandardCustomFieldInt PhabricatorCursorPagedPolicyAwareQuery $query, $value) { - if (strlen($value)) { + if (phutil_nonempty_scalar($value)) { $query->withApplicationSearchContainsConstraint( $this->newNumericIndex(null), $value); @@ -84,7 +84,7 @@ final class PhabricatorStandardCustomFieldInt foreach ($xactions as $xaction) { $value = $xaction->getNewValue(); - if (strlen($value)) { + if (phutil_nonempty_scalar($value)) { if (!preg_match('/^-?\d+/', $value)) { $errors[] = new PhabricatorApplicationTransactionValidationError( $type, @@ -104,9 +104,9 @@ final class PhabricatorStandardCustomFieldInt $old = $xaction->getOldValue(); $new = $xaction->getNewValue(); - if (!strlen($old) && strlen($new)) { + if (!phutil_nonempty_scalar($old) && phutil_nonempty_scalar($new)) { return true; - } else if (strlen($old) && !strlen($new)) { + } else if (phutil_nonempty_scalar($old) && !phutil_nonempty_scalar($new)) { return true; } else { return ((int)$old !== (int)$new);