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

When adding a device rule in automation, depreciated filters may be reported #5057

Closed
bmfmancini opened this issue Dec 6, 2022 · 4 comments
Assignees
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@bmfmancini
Copy link
Member

add a entry in automation >> Device rules
you will see the below messages

2022-12-05  19:33:42 - CMDPHP PHP ERROR Backtrace:   (/automation_templates.php[38]:form_save(),  /automation_templates.php[202]:CactiErrorHandler())
2022-12-05 19:33:42 - ERROR PHP DEPRECATED: Constant  FILTER_SANITIZE_STRING is deprecated in file:  /var/www/html/cacti/automation_templates.php  on line: 202
@bmfmancini bmfmancini added bug Undesired behaviour unverified Some days we don't have a clue labels Dec 6, 2022
@netniV
Copy link
Member

netniV commented Dec 6, 2022

The definitions of these filters is depreciated in 8.1 I believe. This means that we need to consider an alternative, possibly our own implementation that does the same thing.

FILTER_SANITIZE_STRING

Strip tags and HTML-encode double and single quotes, optionally strip or encode special characters. Encoding quotes can be disabled by setting FILTER_FLAG_NO_ENCODE_QUOTES. (Deprecated as of PHP 8.1.0, use htmlspecialchars() instead.)

FILTER_SANITIZE_STRIPPED

Alias of "string" filter. (Deprecated as of PHP 8.1.0, use htmlspecialchars() instead.)

Alternatively, we just don't filter the string input. But I'm sure @TheWitness would prefer the first option.

@netniV netniV added 3rd Party Change Something that Cacti can't fix directly and removed unverified Some days we don't have a clue labels Dec 6, 2022
@TheWitness TheWitness added the QA Bug created between releases. So, no CHANGELOG entry required label Dec 8, 2022
@TheWitness TheWitness added this to the v1.3.0 milestone Dec 11, 2022
@TheWitness TheWitness changed the title 1.3.0 - QA when adding a device rule in automation deprecated messages occour 1.2.23 - QA when adding a device rule in automation deprecated messages occour Dec 15, 2022
@TheWitness TheWitness modified the milestones: v1.3.0, v1.2.23 Dec 15, 2022
@TheWitness TheWitness changed the title 1.2.23 - QA when adding a device rule in automation deprecated messages occour 1.2.23 - PHP8.1 when adding a device rule in automation deprecated messages occour Dec 15, 2022
TheWitness added a commit that referenced this issue Dec 15, 2022
PHP8.1 when adding a device rule in automation deprecated messages occur
TheWitness added a commit that referenced this issue Dec 15, 2022
TheWitness added a commit that referenced this issue Dec 15, 2022
@TheWitness
Copy link
Member

This should be resolved now.

@TheWitness TheWitness added resolved A fixed issue and removed 3rd Party Change Something that Cacti can't fix directly QA Bug created between releases. So, no CHANGELOG entry required labels Dec 15, 2022
@netniV
Copy link
Member

netniV commented Dec 15, 2022

I know there's a 1.3.x QA issue around FILTER_xxx so there's probably more.

@TheWitness
Copy link
Member

This is the one, I relabeled it as it impacts 1.2.23. So, I think we are good now.

@netniV netniV changed the title 1.2.23 - PHP8.1 when adding a device rule in automation deprecated messages occour When adding a device rule in automation, depreciated filters may be reported Dec 31, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants