Skip to content

Validate the requested image exists within the project - #1665

Open
cpeel wants to merge 1 commit into
DistributedProofreaders:masterfrom
cpeel:validate-page-exists
Open

cpeel wants to merge 1 commit into
DistributedProofreaders:masterfrom
cpeel:validate-page-exists

Conversation

@cpeel

@cpeel cpeel commented Sep 30, 2026

Copy link
Copy Markdown
Member

Diff links from other pages should always have valid $image values for a project, but if the user is adjusting the URL by hand the image they request might not exist in the project.

This validation ensures that the rest of the page works instead of these from the php_errors file:

29-Sep-2026 23:02:12 America/New_York
    PHP Warning:  foreach() argument must be of type array|object, null given in /data/htdocs/c/tools/project_manager/diff.php on line 332
    TypeError: get_navigation(): Argument #5 ($L_user) must be of type string, null given, called in /data/htdocs/c/tools/project_manager/diff.php on line 114 and defined in /data/htdocs/c/tools/project_manager/diff.php:185
Stack trace:
#0 /data/htdocs/c/tools/project_manager/diff.php(114): get_navigation()
#1 {main}

@cpeel
cpeel requested review from bpfoley and srjfoo September 30, 2026 18:25
@cpeel cpeel self-assigned this Sep 30, 2026

@bpfoley bpfoley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This makes the if (!$project->pages_table_exists) { ... } below redundant (get_project_page checks that first, and throws an exception).

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.

3 participants