diff --git a/NEWS.mdtext b/NEWS.mdtext index 51e6e84..3917879 100644 --- a/NEWS.mdtext +++ b/NEWS.mdtext @@ -33,6 +33,8 @@ or newer to properly run this version of Indefero! ATTENTION: This needs Pluf 46b7f251 or newer! - Fix the branch links users of the Subversion frontend get when they enter a wrong revision and only display this list if there are any branches available for all SCMs +- If git's author name is not encoded in an UTF-8 compatible encoding, skip the author lookup, + as we have no information what the author string is actually encoded in ## Documentation diff --git a/src/IDF/Scm/Git.php b/src/IDF/Scm/Git.php index f02f018..e56ca74 100644 --- a/src/IDF/Scm/Git.php +++ b/src/IDF/Scm/Git.php @@ -346,6 +346,14 @@ class IDF_Scm_Git extends IDF_Scm if (!preg_match('/<(.*)>/', $author, $match)) { return null; } + // FIXME: newer git versions know a i18n.commitencoding setting which + // leads to another header, "encoding", with which we _could_ try to + // decode the string into utf8. Unfortunately this does not always + // work, especially not in older repos, so we would then still have + // to supply some fallback. + if (!mb_check_encoding($match[1], 'UTF-8')) { + return null; + } $sql = new Pluf_SQL('login=%s', array($match[1])); $users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen())); if ($users->count() > 0) {