Add themes, safer ad interstitial, and installer - #25
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| $salt = bin2hex(random_bytes(16)); | ||
|
|
||
| $configContent = "<?php\nreturn [\n 'DB_HOST' => '" . addslashes($dbHost) . "',\n 'DB_NAME' => '" . addslashes($dbName) . "',\n 'DB_USER' => '" . addslashes($dbUser) . "',\n 'DB_PASS' => '" . addslashes($dbPass) . "',\n 'BASE_URL' => '" . addslashes($baseUrl) . "',\n 'SESSION_SALT' => '" . $salt . "',\n 'TELEGRAM_BOT_TOKEN' => '',\n 'TELEGRAM_CHAT_ID' => '',\n 'TELEGRAM_ADMIN_IDS' => [],\n 'CACHE_PATH' => __DIR__ . '/../cache',\n 'CACHE_TTL' => [\n 'settings' => 300,\n 'home' => 45,\n 'article' => 45,\n ],\n];\n"; | ||
| file_put_contents($configPath, $configContent); | ||
|
|
There was a problem hiding this comment.
Protect installer from overwriting existing config
The new installer blindly rewrites app/config/config.php on every POST without any authentication or check that the app is already installed, so anyone who can reach /install.php can clobber database credentials and salts after deployment. Because file_put_contents runs before any guard, a stray request can break or hijack the site even when it is already configured.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task