Open kdfarquharson opened 2 years ago
There are 6 references to the RemoveUnallowedCharacters in PnP.Framework 2 in ObjectHandlers\ObjectHierarchySequenceSites.cs 1 in ObjectHandlers\ObjectTeams.cs 3 in Sites\SiteCollection.cs 5 refer to Alias, 1 (in ObjectTeams.cs) refers to MailNickname, which is related to Alias. Both Alias and MailNickName can have full stops in them in the UI Would it therefore be acceptible to update the existing RemoveUnallowedCharacters method to take out the removal of full stops? Does anyone know why it removes full stops?
When creating a new site with full stops in the Alias these are removed. Sites can be created manually through the SharePoint UI with full stops in their URL. The associated group retains the full stops in its name.
Steps to recreate: $adminsString = 'Adminn@TenantName.onmicrosoft.com' $siteName = 'New site with Full Stops.' $siteAlias = 'GBL.SharePoint.FullStop.Test' $SiteDescription = 'Site Description' $newSite = New-PnPSite -Type TeamSite -Title $SiteName -Alias $SiteAlias -Description $SiteDescription -Owners $adminsString $newSite https://TenantName.sharepoint.com/sites/GBLSharePointFullStopTest
The following site can be created in the tenant from the SharePoint admin page: https://TenantName.sharepoint.com/sites/Test.Full.Stops/SitePages/Home.aspx
Source - it appears to be from the PnPFramework\Sites\SiteCollection.cs file (this call or one of the similar ones):
Which goes to PnP.Framework\Utilities\UrlUtility.cs
Which removes the full stops.
As I'm new to PnP & Github what's the best way to resolve this? I'm not sure where else RemoveUnallowedCharacters is called from or for what purpose so don't want to just remove the dot replacement from the regex as it might be required elsewhere:
const string unallowedCharacters = "[&,!@;:#¤
´~¨='%<>/\\\"\$\*\^\+\|\{\}\[\]\(\)\?\s]";`