Skip to content

fix(SetupChecks): allow compatible X-Robots-Tag directives - #64573

Open
joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-setupChecks-value-ordering-compatible
Open

joshtrichards wants to merge 2 commits into
masterfrom
jtr/fix-setupChecks-value-ordering-compatible

Conversation

@joshtrichards

@joshtrichards joshtrichards commented Sep 19, 2026

Copy link
Copy Markdown
Member

Summary

Builds on #64571 -

Preserve the required noindex,nofollow directives while allowing compatible additions such as noarchive, nosnippet, noimageindex, and notranslate. Still disallow incompatible combinations.

Includes updated tests.

TODO

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@joshtrichards joshtrichards added this to the Nextcloud 36 milestone Sep 19, 2026
@joshtrichards
joshtrichards requested a review from a team as a code owner September 19, 2026 18:51
@joshtrichards
joshtrichards added this pull request to stack #64574 September 19, 2026 18:51
@joshtrichards
joshtrichards removed the request for review from a team September 19, 2026 18:51
@joshtrichards joshtrichards added the 3. to review Waiting for reviews label Sep 19, 2026
@joshtrichards joshtrichards changed the title fix(settings): allow compatible X-Robots-Tag directives fix(SetupChecks): allow compatible X-Robots-Tag directives Sep 19, 2026
Base automatically changed from jtr/fix-setupChecks-value-ordering to master September 19, 2026 20:44
Preserve the required `noindex,nofollow` directives while allowing compatible additions such as `noarchive`, `nosnippet`, `noimageindex`, and `notranslate`.

Signed-off-by: Josh <josh.t.richards@gmail.com>
Assisted-by: Copilot:gpt-5.6-luna

Signed-off-by: Josh <josh.t.richards@gmail.com>
@come-nc
come-nc force-pushed the jtr/fix-setupChecks-value-ordering-compatible branch from d75be76 to 679b2bf Compare September 19, 2026 20:44

@come-nc come-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I do not know enough of the sysadmin part to approve this one.
I’m also not sure why parseDirective is a callable and not inlined since it’s only used once?

Comment on lines +64 to +67
$directives = array_map(
static fn (string $directive): string => strtolower(trim($directive)),
explode(',', $value)
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should use the same trick as above, why did you implement it different? You can strlower the whole thing.

Suggested change
$directives = array_map(
static fn (string $directive): string => strtolower(trim($directive)),
explode(',', $value)
);
$directives = array_map('trim', explode(',', strtolower($value)));

@MichaIng MichaIng left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

From sysadmin side it makes sense: If noindex, and nofollow are there, everything else is redundant, but does not hurt.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Setup check for X-Robot-Tag expects exact match, resulting in a warning

4 participants