Indefero

Indefero Commit Details


Date:2010-01-20 15:33:53 (14 years 11 months ago)
Author:Loic 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:73641a03d5b4defc9af6a838ff614a7a6ca716cf
Parents: 0b580ba2ec51dd37a1c7e59e0c9043e460417cf9
Message:Fixed issues 368 and 354, access to files with special characters.

Changes:

File differences

src/IDF/Scm.php
371371
372372
373373
374
375
376
377
378
379
380
381
374382
375383
}
}
}
/**
* Given a path, encode everything but the /
*/
public static function smartEncode($path)
{
return str_replace('%2F', '/', rawurlencode($path));
}
}
src/IDF/Scm/Git.php
233233
234234
235235
236
236237
237238
238239
$file->author = 'Unknown';
}
$file->fullpath = ($folder) ? $folder.'/'.$file->file : $file->file;
$file->efullpath = self::smartEncode($file->fullpath);
if ($file->type == 'commit') {
// We have a submodule
$file = $this->getSubmodule($file, $commit);
src/IDF/Scm/Mercurial.php
187187
188188
189189
190
191
190192
191
192
193
194
193195
194196
195197
continue;
}
}
$fullpath = ($folder) ? $folder.'/'.$file : $file;
$efullpath = self::smartEncode($fullpath);
$res[] = (object) array('perm' => $perm, 'type' => $type,
'hash' => $hash, 'fullpath' => ($folder) ? $folder.'/'.$file : $file,
'file' => $file);
'hash' => $hash, 'fullpath' => $fullpath,
'efullpath' => $efullpath, 'file' => $file);
}
return $res;
}
src/IDF/Scm/Svn.php
169169
170170
171171
172
172
173173
174174
175175
......
196196
197197
198198
199
199
200200
201201
202202
......
207207
208208
209209
210
210211
211212
212213
......
253254
254255
255256
256
257
257258
258259
259260
......
280281
281282
282283
283
284
284285
285286
286287
......
498499
499500
500501
501
502
502503
503504
504505
......
534535
535536
536537
537
538
538539
539540
540541
......
565566
566567
567568
568
569
570
571
572
573
574569
575570
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --xml --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.self::urlencode($path)),
escapeshellarg($this->repo.'/'.self::smartEncode($path)),
escapeshellarg($rev));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$xmlInfo = shell_exec($cmd);
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --xml --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.self::urlencode($folder)),
escapeshellarg($this->repo.'/'.self::smartEncode($folder)),
escapeshellarg($commit));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$xml = simplexml_load_string(shell_exec($cmd));
$file['type'] = $this->assoc[(string) $entry['kind']];
$file['file'] = (string) $entry->name;
$file['fullpath'] = $folder.((string) $entry->name);
$file['efullpath'] = self::smartEncode($file['fullpath']);
$file['date'] = gmdate('Y-m-d H:i:s',
strtotime((string) $entry->commit->date));
$file['rev'] = (string) $entry->commit['revision'];
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --xml --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.self::urlencode($filename)),
escapeshellarg($this->repo.'/'.self::smartEncode($filename)),
escapeshellarg($rev));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$xml = simplexml_load_string(shell_exec($cmd));
$cmd = sprintf(Pluf::f('svn_path', 'svn').' cat --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.self::urlencode($def->fullpath)),
escapeshellarg($this->repo.'/'.self::smartEncode($def->fullpath)),
escapeshellarg($def->rev));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
return ($cmd_only) ? $cmd : shell_exec($cmd);
$cmd = sprintf(Pluf::f('svn_path', 'svn').' proplist --xml --username=%s --password=%s %s@%s',
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.self::urlencode($path)),
escapeshellarg($this->repo.'/'.self::smartEncode($path)),
escapeshellarg($rev));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$xmlProps = shell_exec($cmd);
escapeshellarg($property),
escapeshellarg($this->username),
escapeshellarg($this->password),
escapeshellarg($this->repo.'/'.self::urlencode($path)),
escapeshellarg($this->repo.'/'.self::smartEncode($path)),
escapeshellarg($rev));
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
$xmlProp = shell_exec($cmd);
$xml = simplexml_load_string($xmlInfo);
return (string) $xml->entry->commit['revision'];
}
public static function urlencode($string)
{
return str_replace('%2F', '/', urlencode($string));
}
}
src/IDF/Views/Source.php
267267
268268
269269
270
270
271271
272272
273273
......
378378
379379
380380
381
381382
382383
383384
$stack = '';
$i = 0;
foreach ($elts as $elt) {
$stack .= ($i==0) ? $elt : '/'.$elt;
$stack .= ($i==0) ? rawurlencode($elt) : '/'.rawurlencode($elt);
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::tree',
array($project->shortname,
$commit, $stack));
'commit' => $commit,
'cobject' => $cobject,
'fullpath' => $request_file,
'efullpath' => IDF_Scm::smartEncode($request_file),
'base' => $request_file_info->file,
'prev' => $previous,
'tree_in' => $in_branches,
src/IDF/templates/idf/source/git/tree.html
2828
2929
3030
31
31
3232
3333
3434
</tr>
{/if}
{foreach $files as $file}
{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, $commit, $file.fullpath)}
{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, $commit, $file.efullpath)}
<tr>
<td class="fileicon"><img src="{media '/idf/img/'~$file.type~'.png'}" alt="{$file.type}" /></td>
{if $file.type != 'extern'}
src/IDF/templates/idf/source/mercurial/file.html
1818
1919
2020
21
21
2222
2323
2424
{$file}
</tbody>
</table>
{aurl 'url', 'IDF_Views_Source::getFile', array($project.shortname, $commit, $fullpath)}
{aurl 'url', 'IDF_Views_Source::getFile', array($project.shortname, $commit, $efullpath)}
<p class="right soft"><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this file'}</a></p>
{/block}
src/IDF/templates/idf/source/mercurial/tree.html
2828
2929
3030
31
31
3232
3333
3434
</tr>
{/if}
{foreach $files as $file}
{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, $commit, $file.fullpath)}
{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, $commit, $file.efullpath)}
<tr>
<td class="fileicon"><img src="{media '/idf/img/'~$file.type~'.png'}" alt="{$file.type}" /></td>
<td{if $file.type != 'blob'} colspan="4"{/if}><a href="{$url}">{$file.file}</a></td>
src/IDF/templates/idf/source/svn/file.html
2828
2929
3030
31
31
3232
3333
3434
{$file}
</tbody>
</table>
{aurl 'url', 'IDF_Views_Source::getFile', array($project.shortname, $commit, $fullpath)}
{aurl 'url', 'IDF_Views_Source::getFile', array($project.shortname, $commit, $efullpath)}
<p class="right soft"><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}">{trans 'Download this file'}</a></p>
{/block}
src/IDF/templates/idf/source/svn/tree.html
4040
4141
4242
43
43
4444
4545
4646
</tr>
{/if}
{foreach $files as $file}
{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, $commit, $file.fullpath)}
{aurl 'url', 'IDF_Views_Source::tree', array($project.shortname, $commit, $file.efullpath)}
<tr>
<td class="fileicon"><img src="{media '/idf/img/'~$file.type~'.png'}" alt="{$file.type}" /></td>

Archive Download the corresponding diff file

Page rendered in 0.10466s using 15 queries.