mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 04:34:19 +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 )
|
public PenumbraApiEc AddMod( string modDirectory )
|
||||||
{
|
{
|
||||||
CheckInitialized();
|
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 )
|
if( !dir.Exists )
|
||||||
{
|
{
|
||||||
return PenumbraApiEc.FileMissing;
|
return PenumbraApiEc.FileMissing;
|
||||||
|
|
@ -572,7 +572,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
return ( PenumbraApiEc.InvalidArgument, string.Empty );
|
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 ) )
|
|| Penumbra.TempMods.Collections.ContainsKey( character ) )
|
||||||
{
|
{
|
||||||
return ( PenumbraApiEc.CharacterCollectionExists, string.Empty );
|
return ( PenumbraApiEc.CharacterCollectionExists, string.Empty );
|
||||||
|
|
@ -682,7 +682,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
CheckInitialized();
|
CheckInitialized();
|
||||||
var collection = Penumbra.TempMods.Collections.TryGetValue( characterName, out var c )
|
var collection = Penumbra.TempMods.Collections.TryGetValue( characterName, out var c )
|
||||||
? c
|
? c
|
||||||
: Penumbra.CollectionManager.Individual( NameToIdentifier(characterName) );
|
: Penumbra.CollectionManager.Individual( NameToIdentifier( characterName ) );
|
||||||
var set = collection.MetaCache?.Manipulations.ToArray() ?? Array.Empty< MetaManipulation >();
|
var set = collection.MetaCache?.Manipulations.ToArray() ?? Array.Empty< MetaManipulation >();
|
||||||
return Functions.ToCompressedBase64( set, MetaManipulation.CurrentVersion );
|
return Functions.ToCompressedBase64( set, MetaManipulation.CurrentVersion );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue