summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModHelpers
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-02-19 20:18:30 -0500
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-02-19 20:18:30 -0500
commit3b4e81bf69e28c9bcc33c782f58e5099d73c4f91 (patch)
treeaf170db0e147740b7acaa231b59d11a87ad15ad6 /src/SMAPI/Framework/ModHelpers
parent049952de33b9d3e1ba81c27212f75268d8ed76f1 (diff)
downloadSMAPI-3b4e81bf69e28c9bcc33c782f58e5099d73c4f91.tar.gz
SMAPI-3b4e81bf69e28c9bcc33c782f58e5099d73c4f91.tar.bz2
SMAPI-3b4e81bf69e28c9bcc33c782f58e5099d73c4f91.zip
encapsulate path utilities for reuse, add unit tests
Diffstat (limited to 'src/SMAPI/Framework/ModHelpers')
-rw-r--r--src/SMAPI/Framework/ModHelpers/ContentHelper.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs
index 4a1d3853..7d8bec1e 100644
--- a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs
@@ -8,6 +8,7 @@ using System.Linq;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using StardewModdingAPI.Framework.Exceptions;
+using StardewModdingAPI.Framework.Utilities;
using StardewValley;
using xTile;
using xTile.Format;
@@ -238,7 +239,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
string imageSource = tilesheet.ImageSource;
// validate tilesheet path
- if (Path.IsPathRooted(imageSource) || imageSource.Split(SContentManager.PossiblePathSeparators).Contains(".."))
+ if (Path.IsPathRooted(imageSource) || PathUtilities.GetSegments(imageSource).Contains(".."))
throw new ContentLoadException($"The '{imageSource}' tilesheet couldn't be loaded. Tilesheet paths must be a relative path without directory climbing (../).");
// get seasonal name (if applicable)