Allow apostrophes and single quotes in folder names, but don't allow double quotes. Fixes #787

This commit is contained in:
Hylke Bons 2012-06-14 13:54:59 +01:00
parent febd993f29
commit 07c4d271e3
3 changed files with 9 additions and 10 deletions

View file

@ -43,7 +43,7 @@ namespace SparkleLib.Git {
!uri.Scheme.Equals ("http") &&
!uri.Scheme.Equals ("git")) {
uri = new Uri ("ssh://" + uri);
uri = new Uri ("ssh://" + uri);
}
if (uri.Host.Equals ("gitorious.org")) {
@ -67,12 +67,10 @@ namespace SparkleLib.Git {
!uri.Scheme.Equals ("https") &&
!uri.Scheme.Equals ("http")) {
if (uri.Port == -1) {
uri = new Uri (uri.Scheme + "://git@" + uri.Host + uri.AbsolutePath);
} else {
uri = new Uri (uri.Scheme + "://git@" + uri.Host + ":" + uri.Port + uri.AbsolutePath);
}
if (uri.Port == -1)
uri = new Uri (uri.Scheme + "://git@" + uri.Host + uri.AbsolutePath);
else
uri = new Uri (uri.Scheme + "://git@" + uri.Host + ":" + uri.Port + uri.AbsolutePath);
}
}

View file

@ -84,7 +84,7 @@ namespace SparkleLib {
}
FullPath = Path.Combine (config_path, config_file_name);
LogFilePath = Path.Combine (config_path, "debug.log");
LogFilePath = Path.Combine (config_path, "debug.txt");
if (File.Exists (LogFilePath)) {
try {
@ -296,7 +296,7 @@ namespace SparkleLib {
private XmlNode GetFolder (string name)
{
return SelectSingleNode (string.Format ("/sparkleshare/folder[name='{0}']", name));
return SelectSingleNode (string.Format ("/sparkleshare/folder[name=\"{0}\"]", name));
}

View file

@ -384,7 +384,8 @@ namespace SparkleShare {
bool fields_valid = (address != null &&
address.Trim ().Length > 0 &&
remote_path != null &&
remote_path.Trim ().Length > 0);
remote_path.Trim ().Length > 0 &&
!remote_path.Contains ("\""));
if (UpdateAddProjectButtonEvent != null)
UpdateAddProjectButtonEvent (fields_valid);