Skip to content

Php84 twig vichan upstream#16

Closed
assada wants to merge 4 commits intomasterfrom
php84_twig_vichan-upstream
Closed

Php84 twig vichan upstream#16
assada wants to merge 4 commits intomasterfrom
php84_twig_vichan-upstream

Conversation

@assada
Copy link
Copy Markdown
Member

@assada assada commented Jun 21, 2025

This is terrible. But it works!

@assada assada requested a review from Copilot June 21, 2025 20:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes the Tinyboard codebase by adding strict typing and updated PHP features, refactoring various functions for improved clarity and consistency, and updating Twig I18n extensions and theme rebuild routines. Key changes include using fetch(PDO::FETCH_ASSOC) in database queries, adding type declarations throughout the PHP code, and enhancing mobile support in JavaScript.

Reviewed Changes

Copilot reviewed 101 out of 109 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/*.php Updates to use PDO fetch modes with minor refactorings.
templates/* Removal of unused whitespace filters in template files.
securimage.php Transition to explicit PHP types and improved output buffering.
search.php Refactoring search rate‐limiting logic and variable naming consistency.
post.php, mod.php Extensive refactoring to modernize authentication, routing, and error handling with stricter type hints.
js/* Adjustments to quick reply and upload UI for better mobile support.
inc/* Various updates: adding strict types, modernizing Twig extensions, adjusting error and database handling, and removing deprecated polyfills.
Files not reviewed (2)
  • .idea/php.xml: Language not supported
  • .idea/vichan.iml: Language not supported

Comment thread search.php
Comment on lines 33 to +35
$query->bindValue(':time', time() - ($queries_per_minutes[1] * 60));
$query->execute() or error(db_error($query));
if ($query->fetchColumn() > $queries_per_minutes[0]) {
if($query->fetchColumn() > $queries_per_minutes[0])
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

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

The variable '$queries_per_minutes' is used for rate-limiting individual IP queries but is not defined in this diff. Consider replacing it with '$queries_per_minutes_all' or ensuring that '$queries_per_minutes' is properly declared.

Copilot uses AI. Check for mistakes.
Comment thread inc/display.php
)));
}
else {
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
Copy link

Copilot AI Jun 21, 2025

Choose a reason for hiding this comment

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

It is recommended to call exit() or die() after sending an error header in the non-syslog branch to ensure that the script stops executing.

Suggested change
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
die();

Copilot uses AI. Check for mistakes.
@assada assada closed this Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants