mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Use Path.Join and Path.GetFileName for adding mods to not allow arbitrary folder but only those in the penumbra root directory.
This commit is contained in:
parent
4309ae8ce2
commit
353694177e
1 changed files with 3 additions and 3 deletions
|
|
@ -371,7 +371,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
public PenumbraApiEc AddMod( string modDirectory )
|
||||
{
|
||||
CheckInitialized();
|
||||
var dir = new DirectoryInfo( Path.Combine( Penumbra.ModManager.BasePath.FullName, modDirectory ) );
|
||||
var dir = new DirectoryInfo( Path.Join( Penumbra.ModManager.BasePath.FullName, modDirectory ) );
|
||||
if( !dir.Exists )
|
||||
{
|
||||
return PenumbraApiEc.FileMissing;
|
||||
|
|
@ -572,7 +572,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
return ( PenumbraApiEc.InvalidArgument, string.Empty );
|
||||
}
|
||||
|
||||
if( !forceOverwriteCharacter && Penumbra.CollectionManager.Individuals.Individuals.ContainsKey( NameToIdentifier(character) )
|
||||
if( !forceOverwriteCharacter && Penumbra.CollectionManager.Individuals.Individuals.ContainsKey( NameToIdentifier( character ) )
|
||||
|| Penumbra.TempMods.Collections.ContainsKey( character ) )
|
||||
{
|
||||
return ( PenumbraApiEc.CharacterCollectionExists, string.Empty );
|
||||
|
|
@ -682,7 +682,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
CheckInitialized();
|
||||
var collection = Penumbra.TempMods.Collections.TryGetValue( characterName, out var c )
|
||||
? c
|
||||
: Penumbra.CollectionManager.Individual( NameToIdentifier(characterName) );
|
||||
: Penumbra.CollectionManager.Individual( NameToIdentifier( characterName ) );
|
||||
var set = collection.MetaCache?.Manipulations.ToArray() ?? Array.Empty< MetaManipulation >();
|
||||
return Functions.ToCompressedBase64( set, MetaManipulation.CurrentVersion );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue