possible skip variable use before defined in _filter_xss_attributes

Just want to eliminate notices from PHP.

Comments

zero2one’s picture

Status: Active » Closed (works as designed)

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

Anonymous’s picture

Issue summary: View changes
Status: Closed (works as designed) » Active

It doesn't matter if the loop will go through the 0. It's a bad code and as such should be properly fixed.

pjcdawkins’s picture

Priority: Normal » Minor

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.

Status: Active » Closed (outdated)

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.