Fixed issues 368 and 354, access to files with special characters.
This commit is contained in:
@@ -233,6 +233,7 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
$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);
|
||||
|
@@ -187,9 +187,11 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
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;
|
||||
}
|
||||
|
@@ -169,7 +169,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
$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);
|
||||
@@ -196,7 +196,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
$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));
|
||||
@@ -207,6 +207,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
$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'];
|
||||
@@ -253,7 +254,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
$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));
|
||||
@@ -280,7 +281,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
$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);
|
||||
@@ -498,7 +499,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
$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);
|
||||
@@ -534,7 +535,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
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);
|
||||
@@ -565,11 +566,5 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
$xml = simplexml_load_string($xmlInfo);
|
||||
return (string) $xml->entry->commit['revision'];
|
||||
}
|
||||
|
||||
|
||||
public static function urlencode($string)
|
||||
{
|
||||
return str_replace('%2F', '/', urlencode($string));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user