Skip to content

Commit

Permalink
Merge pull request #1 from umbraco/dev-v7
Browse files Browse the repository at this point in the history
update original fork
  • Loading branch information
danieland committed Sep 27, 2015
2 parents 9ce1ea6 + 407cd0c commit 5310ce3
Show file tree
Hide file tree
Showing 208 changed files with 3,534 additions and 1,899 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/umbraco.*
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/routes.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/app.dev.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/loader.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/loader.dev.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/main.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/app.js

Expand Down
4 changes: 2 additions & 2 deletions build/NuSpecs/UmbracoCms.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<dependency id="AutoMapper" version="[3.0.0, 3.1.0)" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 7.0.0)" />
<dependency id="Examine" version="[0.1.68, 1.0.0)" />
<dependency id="ImageProcessor" version="[1.9.5, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[3.3.1, 5.0.0)" />
<dependency id="ImageProcessor" version="[2.3.0, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[4.4.0, 5.0.0)" />
<dependency id="semver" version="[1.1.2, 2.0.0)" />
<dependency id="Microsoft.AspNet.WebHelpers" version="[3.2.3, 4.0.0)" />
<dependency id="Microsoft.AspNet.WebPages.Data" version="[3.2.3, 4.0.0)" />
Expand Down
5 changes: 1 addition & 4 deletions build/NuSpecs/tools/Web.config.install.xdt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
<appSettings>
<add key="owin:appStartup" value="UmbracoDefaultOwinStartup" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
</appSettings>
<appSettings>
<add key="owin:appStartup" value="UmbracoDefaultOwinStartup" xdt:Locator="Match(key)" xdt:Transform="SetAttributes" />
</appSettings>


<umbracoConfiguration xdt:Transform="InsertIfMissing">
<settings configSource="config\umbracoSettings.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
<BaseRestExtensions configSource="config\BaseRestExtensions.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
Expand Down
3 changes: 1 addition & 2 deletions build/UmbracoVersion.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
7.3.0
RC
7.3.0
7 changes: 7 additions & 0 deletions src/NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="umbracocore" value="http://www.myget.org/f/umbracocore/" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion src/SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
[assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyFileVersion("7.3.0")]
[assembly: AssemblyInformationalVersion("7.3.0-RC")]
[assembly: AssemblyInformationalVersion("7.3.0")]
2 changes: 1 addition & 1 deletion src/Umbraco.Core/Configuration/UmbracoVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static Version Current
/// Gets the version comment (like beta or RC).
/// </summary>
/// <value>The version comment.</value>
public static string CurrentComment { get { return "RC"; } }
public static string CurrentComment { get { return ""; } }

// Get the version of the umbraco.dll by looking at a class in that dll
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
Expand Down
48 changes: 33 additions & 15 deletions src/Umbraco.Core/IO/IOHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,7 @@ internal static string ReturnPath(string settingsKey, string standardPath)
/// <returns>A value indicating whether the filepath is valid.</returns>
internal static bool VerifyEditPath(string filePath, string validDir)
{
if (filePath.StartsWith(MapPath(SystemDirectories.Root)) == false)
filePath = MapPath(filePath);
if (validDir.StartsWith(MapPath(SystemDirectories.Root)) == false)
validDir = MapPath(validDir);

return filePath.StartsWith(validDir);
return VerifyEditPath(filePath, new[] { validDir });
}

/// <summary>
Expand All @@ -182,15 +177,31 @@ internal static bool ValidateEditPath(string filePath, string validDir)
/// <returns>A value indicating whether the filepath is valid.</returns>
internal static bool VerifyEditPath(string filePath, IEnumerable<string> validDirs)
{
// this is called from ScriptRepository, PartialViewRepository, etc.
// filePath is the fullPath (rooted, filesystem path, can be trusted)
// validDirs are virtual paths (eg ~/Views)
//
// except that for templates, filePath actually is a virtual path

//TODO
// what's below is dirty, there are too many ways to get the root dir, etc.
// not going to fix everything today

var mappedRoot = MapPath(SystemDirectories.Root);
if (filePath.StartsWith(mappedRoot) == false)
filePath = MapPath(filePath);

// yes we can (see above)
//// don't trust what we get, it may contain relative segments
//filePath = Path.GetFullPath(filePath);

foreach (var dir in validDirs)
{
var validDir = dir;
if (filePath.StartsWith(MapPath(SystemDirectories.Root)) == false)
filePath = MapPath(filePath);
if (validDir.StartsWith(MapPath(SystemDirectories.Root)) == false)
if (validDir.StartsWith(mappedRoot) == false)
validDir = MapPath(validDir);

if (filePath.StartsWith(validDir))
if (PathStartsWith(filePath, validDir, Path.DirectorySeparatorChar))
return true;
}

Expand Down Expand Up @@ -219,11 +230,8 @@ internal static bool ValidateEditPath(string filePath, IEnumerable<string> valid
/// <returns>A value indicating whether the filepath is valid.</returns>
internal static bool VerifyFileExtension(string filePath, List<string> validFileExtensions)
{
if (filePath.StartsWith(MapPath(SystemDirectories.Root)) == false)
filePath = MapPath(filePath);
var f = new FileInfo(filePath);

return validFileExtensions.Contains(f.Extension.Substring(1));
var ext = Path.GetExtension(filePath);
return ext != null && validFileExtensions.Contains(ext.TrimStart('.'));
}

/// <summary>
Expand All @@ -240,6 +248,16 @@ internal static bool ValidateFileExtension(string filePath, List<string> validFi
return true;
}

public static bool PathStartsWith(string path, string root, char separator)
{
// either it is identical to root,
// or it is root + separator + anything

if (path.StartsWith(root, StringComparison.OrdinalIgnoreCase) == false) return false;
if (path.Length == root.Length) return true;
if (path.Length < root.Length) return false;
return path[root.Length] == separator;
}

/// <summary>
/// Returns the path to the root of the application, by getting the path to where the assembly where this
Expand Down
Loading

0 comments on commit 5310ce3

Please sign in to comment.