Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #6993: Add a condition to bailout #7251

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Jan 27, 2025

Description

Fixes #6993

It won't show a fatal error if the string is the wrong type.

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Detailed scenario

Refer to the issue.

Technical description

Documentation

This pull request includes a small but important change to the inc/Engine/Optimization/RegexTrait.php file. The change ensures that the html_replace property is a string before checking if it is empty.

New dependencies

None

Risks

None

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

@Miraeld Miraeld requested a review from a team January 27, 2025 02:53
@Miraeld Miraeld self-assigned this Jan 27, 2025
@jeawhanlee
Copy link
Contributor

We have tests and phpstan checks failing

@Miraeld Miraeld force-pushed the fix/6993-type-error-str-replace branch from 7035084 to f57c775 Compare January 27, 2025 11:58
@Miraeld
Copy link
Contributor Author

Miraeld commented Jan 27, 2025

@jeawhanlee Yea, I've fixed the code, I did put the wrong variable in the check. 🙏

Copy link

codacy-production bot commented Jan 27, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 93fef5c1 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (93fef5c) Report Missing Report Missing Report Missing
Head commit (6df1612) 39333 17143 43.58%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#7251) 1 1 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@Miraeld Miraeld requested a review from jeawhanlee January 28, 2025 01:37
@Khadreal
Copy link
Contributor

Khadreal commented Feb 7, 2025

QA done:
testrail-report-700.pdf

@Khadreal
Copy link
Contributor

Khadreal commented Feb 7, 2025

E2E Tests(lcp && llcssbg) are passing

@Miraeld Miraeld added this pull request to the merge queue Feb 10, 2025
Merged via the queue into develop with commit 8a64712 Feb 10, 2025
13 checks passed
@Miraeld Miraeld deleted the fix/6993-type-error-str-replace branch February 10, 2025 01:11
Khadreal pushed a commit that referenced this pull request Feb 11, 2025
Khadreal pushed a commit that referenced this pull request Feb 12, 2025
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.

TypeError null allowed where string required in argument 3 ($subject) of str_replace
3 participants