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,7 +290,7 @@ } protected function getUTF8StringFromStorage($string, $encoding) { - if ($encoding == 'utf8') { + if ($encoding == 'utf8' || !phutil_nonempty_string($string)) { return $string; } @@ -310,7 +310,7 @@ ); } - $guess = mb_detect_encoding($string, $try_encodings); + $guess = mb_detect_encoding($string, $try_encodings = null); if ($guess) { return mb_convert_encoding($string, 'UTF-8', $guess); }