Skip to content
Snippets Groups Projects
Commit 51232b09 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #3194 fix pb path with windows

parent fa191328
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,7 @@ function maarchFilesWhiteList($directory, $isCustom = false, $recursive = true, ...@@ -117,7 +117,7 @@ function maarchFilesWhiteList($directory, $isCustom = false, $recursive = true,
&& file_exists('custom/' . $_SESSION['custom_override_id'] . '/' . $file) && file_exists('custom/' . $_SESSION['custom_override_id'] . '/' . $file)
) { ) {
//$arrayItems[$fileName] = 'custom/' . $_SESSION['custom_override_id'] . '/' . $file; //$arrayItems[$fileName] = 'custom/' . $_SESSION['custom_override_id'] . '/' . $file;
array_push($arrayItems, 'custom/' . $_SESSION['custom_override_id'] . '/' . $file); array_push($arrayItems, 'custom'. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR . $file);
} else { } else {
//$arrayItems[$fileName] = $file; //$arrayItems[$fileName] = $file;
array_push($arrayItems, $file); array_push($arrayItems, $file);
...@@ -162,9 +162,10 @@ if ((!isset($_SESSION['maarchFilesWhiteList']) && count($_SESSION['maarchFilesWh ...@@ -162,9 +162,10 @@ if ((!isset($_SESSION['maarchFilesWhiteList']) && count($_SESSION['maarchFilesWh
} }
} }
} }
for ($z=0;$z<count($modules);$z++) { $countModules = count($modules);
for ($z=0;$z<$countModules;$z++) {
$_SESSION['maarchFilesWhiteList']['modules'][$modules[$z]] = maarchFilesWhiteList( $_SESSION['maarchFilesWhiteList']['modules'][$modules[$z]] = maarchFilesWhiteList(
'modules/' . $modules[$z], 'modules' . DIRECTORY_SEPARATOR . $modules[$z],
$isCustom $isCustom
); );
} }
...@@ -173,20 +174,20 @@ if ((!isset($_SESSION['maarchFilesWhiteList']) && count($_SESSION['maarchFilesWh ...@@ -173,20 +174,20 @@ if ((!isset($_SESSION['maarchFilesWhiteList']) && count($_SESSION['maarchFilesWh
&& !empty($_SESSION['custom_override_id']) && !empty($_SESSION['custom_override_id'])
) { ) {
if (is_dir($_SESSION['config']['corepath'] . 'custom/' . $_SESSION['custom_override_id'] . '/core')) { if (is_dir($_SESSION['config']['corepath'] . 'custom/' . $_SESSION['custom_override_id'] . '/core')) {
$_SESSION['maarchFilesWhiteList']['custom']['core'] = maarchFilesWhiteList('custom/' . $_SESSION['custom_override_id'] . '/core'); $_SESSION['maarchFilesWhiteList']['custom']['core'] = maarchFilesWhiteList('custom'. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id'] . DIRECTORY_SEPARATOR .'core');
$_SESSION['maarchFilesWhiteList']['core'] $_SESSION['maarchFilesWhiteList']['core']
= array_merge($_SESSION['maarchFilesWhiteList']['core'], $_SESSION['maarchFilesWhiteList']['custom']['core']); = array_merge($_SESSION['maarchFilesWhiteList']['core'], $_SESSION['maarchFilesWhiteList']['custom']['core']);
} }
if (is_dir($_SESSION['config']['corepath'] . 'custom/' . $_SESSION['custom_override_id']. '/apps')) { if (is_dir($_SESSION['config']['corepath'] . 'custom/' . $_SESSION['custom_override_id']. '/apps')) {
$_SESSION['maarchFilesWhiteList']['custom']['apps'] = maarchFilesWhiteList('custom/' . $_SESSION['custom_override_id']. '/apps'); $_SESSION['maarchFilesWhiteList']['custom']['apps'] = maarchFilesWhiteList('custom' . DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']. DIRECTORY_SEPARATOR .'apps');
$_SESSION['maarchFilesWhiteList']['apps'] $_SESSION['maarchFilesWhiteList']['apps']
= array_merge($_SESSION['maarchFilesWhiteList']['apps'], $_SESSION['maarchFilesWhiteList']['custom']['apps']); = array_merge($_SESSION['maarchFilesWhiteList']['apps'], $_SESSION['maarchFilesWhiteList']['custom']['apps']);
} }
for ($z=0;$z<count($modules);$z++) { for ($z=0;$z<$countModules;$z++) {
if (is_dir($_SESSION['config']['corepath'] . 'custom/' . $_SESSION['custom_override_id']. '/modules/' . $modules[$z])) { if (is_dir($_SESSION['config']['corepath'] . 'custom/' . $_SESSION['custom_override_id']. '/modules/' . $modules[$z])) {
$_SESSION['maarchFilesWhiteList']['custom']['modules'][$modules[$z]] = maarchFilesWhiteList( $_SESSION['maarchFilesWhiteList']['custom']['modules'][$modules[$z]] = maarchFilesWhiteList(
'custom/' . $_SESSION['custom_override_id']. '/modules/' . $modules[$z], 'custom'. DIRECTORY_SEPARATOR . $_SESSION['custom_override_id']. DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $modules[$z],
$isCustom $isCustom
); );
$_SESSION['maarchFilesWhiteList']['modules'][$modules[$z]] $_SESSION['maarchFilesWhiteList']['modules'][$modules[$z]]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment