diff --git a/src/applications/repository/xaction/PhabricatorRepositoryIdentityAssignTransaction.php b/src/applications/repository/xaction/PhabricatorRepositoryIdentityAssignTransaction.php --- a/src/applications/repository/xaction/PhabricatorRepositoryIdentityAssignTransaction.php +++ b/src/applications/repository/xaction/PhabricatorRepositoryIdentityAssignTransaction.php @@ -52,7 +52,7 @@ foreach ($xactions as $xaction) { $old = $xaction->getOldValue(); $new = $xaction->getNewValue(); - if (!strlen($new)) { + if (!phutil_nonempty_string($new)) { continue; } diff --git a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php --- a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php +++ b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php @@ -290,12 +290,12 @@ } protected function getUTF8StringFromStorage($string, $encoding) { - if ($encoding == 'utf8') { + if ($encoding == 'utf8' || !phutil_nonempty_string($string)) { return $string; } if (function_exists('mb_detect_encoding')) { - if (strlen($encoding)) { + if (phutil_nonempty_string($encoding)) { $try_encodings = array( $encoding, );