possible skip variable use before defined in _filter_xss_attributes
Just want to eliminate notices from PHP.
The while loop will always go through the "0"-phase.
As long as the if-statement within the 0-phase is not TRUE, the $mode remains 0.
If you pass an empty string to the function the $mode variable remains 0
so the last if statement:
if ($mode == 1 && !$skip) { $attrarr[] = $attrname; }
Will not check the !$skip
It doesn't matter if the loop will go through the 0. It's a bad code and as such should be properly fixed.
This was already changed to be more explicit in D8: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Util...
As it's not actually a bug, I expect it's not the sort of thing that would be changed in D7.
Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.
Comments
Comment #1
zero2one commentedThe while loop will always go through the "0"-phase.
As long as the if-statement within the 0-phase is not TRUE, the $mode remains 0.
If you pass an empty string to the function the $mode variable remains 0
so the last if statement:
Will not check the !$skip
Comment #2
Anonymous (not verified) commentedIt doesn't matter if the loop will go through the 0. It's a bad code and as such should be properly fixed.
Comment #3
pjcdawkins commentedThis was already changed to be more explicit in D8: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Util...
As it's not actually a bug, I expect it's not the sort of thing that would be changed in D7.