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

Remove unnecessary functionality from escapeOrCleanHtml #4320

Merged

Conversation

demiankatz
Copy link
Member

@demiankatz demiankatz commented Apr 1, 2025

escapeOrCleanHtml included a mechanism for obtaining the whole object through the __invoke method, but this was neither used nor needed and had the potential to cause weird side effects. This PR simplifies the helper by removing the unwanted logic.

@demiankatz demiankatz added this to the 11.0 milestone Apr 1, 2025
@maccabeelevine
Copy link
Member

in one of our tests, a title part was null,

I'm looking through EscapeOrCleanHtmlTest, and also CleanHtmlTest, and not finding this test -- where is it? Trying to make it fail with the behavior you saw before I test the fix. Just running the test classes with PhpUnitFast isn't making them fail.

@demiankatz
Copy link
Member Author

@maccabeelevine, it's one of the Mink integration tests that's failing; the unit tests don't catch this. You can see the details if you look at Jenkins.

Copy link
Member

@maccabeelevine maccabeelevine left a comment

Choose a reason for hiding this comment

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

The solution seems reasonable but I don't understand the original behavior (returning $this) enough to be confident.

@demiankatz demiankatz changed the title Make escapeOrCleanHtml more tolerant of null values Remove unnecessary functionality from escapeOrCleanHtml Apr 2, 2025
Copy link
Member

@maccabeelevine maccabeelevine left a comment

Choose a reason for hiding this comment

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

This seems straightforward now!

@demiankatz demiankatz removed the request for review from EreMaijala April 2, 2025 13:18
@demiankatz demiankatz merged commit ad68e68 into vufind-org:dev Apr 2, 2025
6 checks passed
@demiankatz demiankatz deleted the fix-escapeorcleanhtml-null-handling branch April 2, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants