I solved some issues with Directory traversal

This commit is contained in:
Paula V. Quispe
2015-03-26 16:14:32 -04:00
parent 1bb9f57152
commit c595bd10bf
4 changed files with 14 additions and 2 deletions

View File

@@ -320,6 +320,8 @@ function importSkin ()
function exportSkin ($skinToExport = "")
{
try {
G::LoadSystem('inputfilter');
$filter = new InputFilter();
if (! isset( $_REQUEST['SKIN_FOLDER_ID'] )) {
throw (new Exception( G::LoadTranslation( 'ID_SKIN_NAME_REQUIRED' ) ));
}
@@ -329,6 +331,7 @@ function exportSkin ($skinToExport = "")
$skinFolderBase = PATH_CUSTOM_SKINS . $skinName;
$skinFolder = $skinFolderBase . PATH_SEP;
$skinTar = PATH_CUSTOM_SKINS . $skinName . '.tar';
$skinTar = $filter->xssFilterHard($skinTar, 'path');
if (! is_dir( $skinFolder )) {
throw (new Exception( G::LoadTranslation( 'ID_SKIN_DOESNT_EXIST' ) ));
}