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

Use a custom htmlescape() function to handle unexpected null values #17936

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

cedric-anne
Copy link
Member

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.

Description

Fixes #17933.

There are many places in our code where htmlspecialchars() may be call for a null value (or even an integer, a float, ...). Instead of using the ?? '' to fix occurences that triggers a deprecation notice, I propose to use a custom htmlescape() function that ensures that non-string legitimate values are correctly handled.

src/AuthLDAP.php Outdated Show resolved Hide resolved
@cedric-anne
Copy link
Member Author

Required for #17981.

@cedric-anne cedric-anne merged commit 188d7d4 into glpi-project:main Oct 30, 2024
7 checks passed
@cedric-anne cedric-anne deleted the 11.0/htmlescape branch October 30, 2024 09:10
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.

[main] deprecated htmlspecialchars error in setup > general > assistance (planning dropdowns)
3 participants