getInput(); // Feldname aus dem Config-Template $path = (string) $input->post->get('document_root', '', 'string'); $path = trim($path); // Minimal-Validierung & Normalisierung // (Hier kein striktes is_readable(), damit man den Pfad auch erst konfigurieren kann, // wenn das Verzeichnis später angelegt/umgehängt wird. Warnen ist aber hilfreich.) if ($path === '') { $app->enqueueMessage(Text::_('COM_EIS_MSG_INVALID_PATH') ?: 'Bitte einen gültigen Pfad angeben.', 'warning'); $this->setRedirect(Route::_('index.php?option=com_eis&view=config', false)); return; } // Doppelte Slashes und trailing Slash bereinigen $path = preg_replace('#/+#', '/', $path); // Lass den Root-Slash stehen, entferne sonst trailing Slash if ($path !== '/' && str_ends_with($path, '/')) { $path = rtrim($path, '/'); } // Optional: Hinweise zur Existenz/Lesbarkeit (nur Hinweis, kein Hard-Error) if (!is_dir($path)) { $app->enqueueMessage(Text::sprintf('COM_EIS_MSG_PATH_NOT_EXISTS', $path) ?: "Hinweis: Verzeichnis existiert nicht: {$path}", 'notice'); } elseif (!is_readable($path)) { $app->enqueueMessage(Text::sprintf('COM_EIS_MSG_PATH_NOT_READABLE', $path) ?: "Hinweis: Verzeichnis nicht lesbar: {$path}", 'notice'); } // Persistieren SettingsHelper::setSetting('document_root', $path); $app->enqueueMessage(Text::_('COM_EIS_MSG_SAVED_SUCCESS') ?: 'Einstellungen wurden gespeichert.', 'message'); $this->setRedirect(Route::_('index.php?option=com_eis&view=config', false)); } }