Skip to content

Build shared-hosting news site with ad flow and themes#28

Open
huzely wants to merge 1 commit intomasterfrom
codex/develop-complete-news-website-source-code-1tq2pe
Open

Build shared-hosting news site with ad flow and themes#28
huzely wants to merge 1 commit intomasterfrom
codex/develop-complete-news-website-source-code-1tq2pe

Conversation

@huzely
Copy link
Copy Markdown
Owner

@huzely huzely commented Dec 25, 2025

Summary

  • rebuild news portal to required public_html structure with themeable frontend, slug routing via .htaccess, and Shopee overlay flow
  • add admin CRUD/settings/stats pages using PDO, CSRF, rate-limit tracking API, and Telegram notification helpers
  • include MySQL schema with seed data, config.php-based settings, and README tailored for dataonline.vn deployment

Testing

  • php -l on all PHP files

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1 to +4
<?php
require_once __DIR__ . '/../app/lib/auth.php';
admin_logout();
header('Location: ' . BASE_URL . '/admin/login.php');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Logout endpoint never invalidates the session

The logout handler calls admin_logout() without ever calling session_start(), while admin_logout() only invokes session_destroy(). PHP ignores session_destroy() when no session is active, so this endpoint redirects without clearing the session cookie or data and the admin remains logged in. Start the session before destroying it (or call session_start() inside admin_logout()) so logout actually ends the session.

Useful? React with 👍 / 👎.

Comment on lines +10 to +14
if (!empty($_FILES['logo']['name'])) {
$ext = pathinfo($_FILES['logo']['name'], PATHINFO_EXTENSION);
$name = 'assets/img/logo_'.time().'.'.$ext;
move_uploaded_file($_FILES['logo']['tmp_name'], __DIR__.'/../'.$name);
$logoPath = $name;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge File uploads accept arbitrary executable types

The settings form saves uploaded logo/banner files directly to public_html/assets/img using the user-supplied extension and without any MIME/type whitelist or path checks. An authenticated admin can therefore upload a PHP file (or other executable) and have it written to a web-accessible location, leading to straightforward remote code execution. Validate the file type and restrict extensions/paths before moving the upload.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant