Skip to content

Commit

Permalink
Merge pull request #1081 from jackpoz/fixes/CreateSiteEndingWithSlash
Browse files Browse the repository at this point in the history
Handle urls ending with / when creating new sites
  • Loading branch information
gautamdsheth authored Nov 16, 2024
2 parents c1bbfec + 1076561 commit 98ff810
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/PnP.Framework/Sites/SiteCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ private static Dictionary<string, object> GetRequestPayload(SiteCreationInformat
if (siteCollectionCreationInformation.Url.IndexOf("/sites/", StringComparison.InvariantCultureIgnoreCase) > -1 || siteCollectionCreationInformation.Url.IndexOf("/teams/", StringComparison.InvariantCultureIgnoreCase) > -1)
{
// Split the URL by '/'
string[] urlParts = siteCollectionCreationInformation.Url.Split('/');
string[] urlParts = siteCollectionCreationInformation.Url.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);

// Get the last part of the URL after "sites"
string lastPart = urlParts[urlParts.Length - 1];
Expand Down

0 comments on commit 98ff810

Please sign in to comment.