Fixed to correctly store utf-8 string in the git cache.

This commit is contained in:
Loïc d'Anterroches 2011-01-24 11:53:24 +01:00
parent 296091e977
commit 207eb1322d
2 changed files with 4 additions and 2 deletions

View File

@ -154,7 +154,7 @@ class IDF_Commit extends Pluf_Model
$commit->summary = self::toUTF8($change->title);
$commit->fullmessage = self::toUTF8($change->full_message);
$commit->author = $scm->findAuthor($change->author);
$commit->origauthor = $change->author;
$commit->origauthor = self::toUTF8($change->author);
$commit->creation_dtime = $change->date;
$commit->create();
$commit->notify($project->getConf());

View File

@ -55,7 +55,9 @@ class IDF_Scm_Cache_Git extends Pluf_Model
$cache->project = $this->_project;
$cache->githash = $blob->hash;
$blob->title = IDF_Commit::toUTF8($blob->title);
$cache->content = $blob->date.chr(31).$blob->author.chr(31).$blob->title;
$cache->content = IDF_Commit::toUTF8($blob->date) . chr(31)
. IDF_Commit::toUTF8($blob->author) . chr(31)
. IDF_Commit::toUTF8($blob->title);
$sql = new Pluf_SQL('project=%s AND githash=%s',
array($this->_project->id, $blob->hash));
if (0 == Pluf::factory(__CLASS__)->getCount(array('filter' => $sql->gen()))) {