$urlStep, 'current' => $currentStep, ]), INSTALLER_BASE_URL.'/' ); } // 같은 경우에도 깔끔한 URL로 리다이렉트 header('Location: '.INSTALLER_BASE_URL.'/'); exit; } $state = getInstallationState(); $errors = []; $formData = []; $error = null; // Step 3 기본값 설정 if ($currentStep === 3) { $defaults = DEFAULT_INSTALL_CONFIG; $defaults['app_url'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST']; $defaults['admin_language'] = getCurrentLanguage(); // state.json에서 비밀번호 제외된 config 복원 (폼에 비밀번호를 사전 입력하지 않음). // state 에는 이미 비밀이 기록되지 않지만(이슈 #465), 레거시 state.json 이 남아 있는 // 환경에서도 평문이 HTML 로 렌더되지 않도록 프리필 단계에서 다시 제거한다. $savedConfig = $state['config'] ?? $defaults; unset( $savedConfig['db_write_password'], $savedConfig['db_read_password'], $savedConfig['admin_password'], $savedConfig['admin_password_confirm'] ); $formData = array_merge($defaults, $savedConfig); } // 설치 흐름 검증 validateInstallationFlow($currentStep, $state); // POST 요청 처리 if ($_SERVER['REQUEST_METHOD'] === 'POST') { handlePostRequest($currentStep, $currentLang, $formData, $errors, $error); } // 번역 로드 if (! isset($translations)) { $translations = loadTranslations($currentLang); } // Step 범위 체크 (0: welcome ~ 6: complete) if ($currentStep < 0 || $currentStep > 6) { $currentStep = 0; } $stepFile = __DIR__.'/views/'.$currentStep.'-'.(STEP_FILE_MAP[$currentStep] ?? 'welcome').'.php'; ?>