* Escape / character when saving items and folders in an iar so that the loader doesn't barf
parent
83b4b4440b
commit
345ddcd0d8
|
@ -161,14 +161,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
failedAssetRestores++;
|
||||
}
|
||||
else if (filePath.StartsWith(ArchiveConstants.INVENTORY_PATH))
|
||||
{
|
||||
{
|
||||
InventoryFolderBase foundFolder
|
||||
= ReplicateArchivePathToUserInventory(
|
||||
filePath, TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType,
|
||||
rootDestinationFolder, foldersCreated, nodesLoaded);
|
||||
|
||||
if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY != entryType)
|
||||
{
|
||||
{
|
||||
// Escape back characters
|
||||
filePath = filePath.Replace("/", "/");
|
||||
filePath = filePath.Replace("&", "&");
|
||||
|
||||
InventoryItemBase item = UserInventoryItemSerializer.Deserialize(data);
|
||||
|
||||
// Don't use the item ID that's in the file
|
||||
|
@ -289,6 +293,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR);
|
||||
|
||||
string newFolderName = rawDirsToCreate[i].Remove(identicalNameIdentifierIndex);
|
||||
|
||||
// Escape back characters
|
||||
newFolderName = newFolderName.Replace("/", "/");
|
||||
newFolderName = newFolderName.Replace("&", "&");
|
||||
|
||||
UUID newFolderId = UUID.Random();
|
||||
|
||||
// Asset type has to be Unknown here rather than Folder, otherwise the created folder can't be
|
||||
|
|
|
@ -394,6 +394,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
/// <returns></returns>
|
||||
public static string CreateArchiveFolderName(string name, UUID id)
|
||||
{
|
||||
// Only encode ampersands (for escaping anything) and / (since this is used as general dir separator).
|
||||
name = name.Replace("&", "&");
|
||||
name = name.Replace("/", "/");
|
||||
|
||||
return string.Format(
|
||||
"{0}{1}{2}/",
|
||||
name,
|
||||
|
@ -409,6 +413,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
/// <returns></returns>
|
||||
public static string CreateArchiveItemName(string name, UUID id)
|
||||
{
|
||||
name = name.Replace("&", "&");
|
||||
name = name.Replace("/", "/");
|
||||
|
||||
return string.Format(
|
||||
"{0}{1}{2}.xml",
|
||||
name,
|
||||
|
|
Loading…
Reference in New Issue