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

Fixes #6887 Check for string to handle null return from get_permalink() #6996

Merged
merged 3 commits into from
Oct 3, 2024

Conversation

remyperona
Copy link
Contributor

@remyperona remyperona commented Sep 30, 2024

Description

Fixes #6887

Prevent PHP fatal error when get_permalink() returns null instead of a string. It should not happen by default but some plugins are doing that.

Type of change

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

Detailed scenario

Explained in #6887

Technical description

Documentation

Use is_string() to make sure the $url is a string before passing it to the delete_by_url() method

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.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.

@remyperona remyperona added type: bug Indicates an unexpected problem or unintended behavior module: OCI Optimize Critical Images labels Sep 30, 2024
@remyperona remyperona added this to the 3.17.1 milestone Sep 30, 2024
@remyperona remyperona requested a review from a team September 30, 2024 20:16
@remyperona remyperona self-assigned this Sep 30, 2024
Copy link

codacy-production bot commented Sep 30, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 73488691 100.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (7348869) Report Missing Report Missing Report Missing
Head commit (93f1c7b) 37742 16581 43.93%

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 (#6996) 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 self-requested a review October 1, 2024 11:56
@Miraeld Miraeld requested a review from a team October 1, 2024 12:02
Copy link

@hanna-meda hanna-meda left a comment

Choose a reason for hiding this comment

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

@Tabrisrp thank you for this PR. Looks good on test env.
Tests results report here:
testrail-report-640.pdf

@remyperona remyperona added this pull request to the merge queue Oct 3, 2024
Merged via the queue into develop with commit dc941a7 Oct 3, 2024
13 of 14 checks passed
@remyperona remyperona deleted the fix/6887-null-url branch October 3, 2024 13:09
@piotrbak piotrbak removed this from the 3.17.1 milestone Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: OCI Optimize Critical Images type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance Hints error: null passed to delete_by_url() when string expected
4 participants