Skip to content

Replace str_contains() with strpos() for PHP 7.4 compatibility (SLOP-133) - #9

Open
tosfos wants to merge 1 commit into
masterfrom
SLOP-133-strpos-compat
Open

tosfos wants to merge 1 commit into
masterfrom
SLOP-133-strpos-compat

Conversation

@tosfos

@tosfos tosfos commented Aug 22, 2026

Copy link
Copy Markdown

Fixes SLOP-133

Summary

  • maintenance/GenerateReport.php called str_contains() (PHP 8.0+), but extension.json declares MediaWiki >= 1.39.0, whose minimum PHP is 7.4.3 — running the script on a supported 1.39/1.40 install fataled with "Call to undefined function".
  • Replaced with an equivalent, PHP 7.4-compatible strpos() check; behavior identical on all versions.

Test plan

  • php -l maintenance/GenerateReport.php passes (php:8.1-cli)
  • Curly-brace rejection behavior unchanged (covered by existing testInvalidArgs case)
  • Grep confirms no other PHP 8-only constructs (str_contains|str_starts_with|str_ends_with|?->|match() remain

Work performed by AI / Cursor Agent under direction of Ike.

Made with Cursor

str_contains() is PHP 8.0+ but the extension declares MediaWiki >= 1.39,
whose minimum PHP is 7.4.3, making the script fatal on supported installs.

Bug: SLOP-133
Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e1d0b810-a1ad-4133-809f-2d6619c47602


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant