Skip to content

Commit 68c14af

Browse files
authored
Merge pull request #53 from BrickOzp/retain_index
Retain attachment dir indexes
2 parents ffe2148 + f8e7f31 commit 68c14af

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

repair_settings.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -773,10 +773,9 @@ function restoreAll()
773773
if (!(isset($array_settings) && is_array($array_settings)) && !is_array($settings[$setting]))
774774
$array_settings = @unserialize($settings[$setting]);
775775
if (!isset($array_settings) || !is_array($array_settings))
776-
$array_settings = array($settings[$setting]);
776+
$array_settings = array(1 => $settings[$setting]);
777777

778-
$item = 1;
779-
foreach ($array_settings as $array_setting)
778+
foreach ($array_settings as $item => $array_setting)
780779
{
781780
$suggested = false;
782781
echo '
@@ -1062,11 +1061,11 @@ function set_settings()
10621061
}
10631062
else
10641063
{
1065-
$attach_count = 1;
10661064
foreach ($setString as $key => $value)
10671065
if (strpos($value[0], 'attachmentUploadDir') == 0 && strpos($value[0], 'attachmentUploadDir') !== false)
10681066
{
1069-
$attach_dirs[$attach_count++] = $value[1];
1067+
$index = substr($value[0], strlen('attachmentUploadDir_'));
1068+
$attach_dirs[$index] = $value[1];
10701069
unset($setString[$key]);
10711070
}
10721071
}

0 commit comments

Comments
 (0)