Replace most substr($a, $i) where $i is negative with str_ends_with()

Created on 21 December 2022, over 1 year ago
Updated 25 January 2024, 4 months ago

Problem/Motivation

Part of 🌱 Replace strpos/substr with PHP 8's str_starts_with() / str_contains() / str_ends_with() Active .

Proposed resolution

  1. Replace most substr($a, $i) == $b where $i is negative with str_ends_with($b).
  2. A few are deliberately omitted where they would cause merge conflicts with other child issues.

Remaining tasks

  • When reviewing, consider using git diff --color-words or git diff --porecelain.
  • Pay attention to the fact that the absolute value of $i should be the length of $b.
  • Pay special attention to \-prefixed characters that have a length of 1. It looks wrong because of the single quotes, but https://3v4l.org/90Tb4

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

πŸ“Œ Task
Status

Fixed

Version

11.0 πŸ”₯

Component
OtherΒ  β†’

Last updated about 13 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States xjm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024