Indefero

Indefero Commit Details


Date:2011-02-01 13:58:24 (13 years 10 months ago)
Author:Loïc d'Anterroches
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:e31f10e648a563b34f1346459f34bd294c08f492
Parents: 336faa4503df5b232aeb219b7dc9829b99811765
Message:Fixed error in the cron job if a key has a bad format.

Changes:

File differences

src/IDF/Key.php
8484
8585
8686
87
87
8888
8989
9090
return array('ssh', $m[2], $m[1]);
}
throw new Exception('invalid or unknown key data detected');
throw new Exception(__('Invalid or unknown key data detected.'));
}
/**
src/IDF/Plugin/SyncGit/Cron.php
4848
4949
5050
51
51
52
53
54
55
56
57
5258
5359
5460
$out = '';
$keys = Pluf::factory('IDF_Key')->getList(array('view'=>'join_user'));
foreach ($keys as $key) {
if ($key->getType() == 'ssh' and preg_match('/^[a-zA-Z][a-zA-Z0-9_.-]*(@[a-zA-Z][a-zA-Z0-9.-]*)?$/', $key->login)) {
try {
$key_type = $key->getType();
} catch (Exception $e) {
// The key is a bad key, skip it
continue;
}
if ($key_type == 'ssh' and preg_match('/^[a-zA-Z][a-zA-Z0-9_.-]*(@[a-zA-Z][a-zA-Z0-9.-]*)?$/', $key->login)) {
$content = trim(str_replace(array("\n", "\r"), '', $key->content));
$out .= sprintf($template, $cmd, $key->login, $content)."\n";
}

Archive Download the corresponding diff file

Page rendered in 0.08199s using 13 queries.