Conversation
There was a problem hiding this comment.
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
| $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]) |
There was a problem hiding this comment.
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.
| ))); | ||
| } | ||
| else { | ||
| header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); |
There was a problem hiding this comment.
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.
| header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); | |
| header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); | |
| die(); |
This is terrible. But it works!