Sometimes disabled (=not enabled) selectors continue 'triggering'.

1) Create and enable two selectors with same font, for example: "h1" "Font1" and ".title" "Font1".
2) Disable one of them.
3) Both are working.

Patch.

PHP 5.3.3 here.

p.s. This is one of the reaon why I personally prefer not to use PHP constructs like foreach($array as &$elem).

Comments

OnkelTem’s picture

StatusFileSize
new1.13 KB

Previous patch has bugs: it disables selectors which are defined _before_ enabled selectors :)
New version - separate loop for cleaning up.

troky’s picture

StatusFileSize
new615 bytes

Yeah, bug confirmed :)
Can you test attached patch? It is slightly simpler than yours.

OnkelTem’s picture

@troky

Yeah, now compare it to the patch in the first comment? ;-)
Look carefully - it may not iterate to the end of $selectors array, since there is a `break` which triggers when a font is found.
For example, in this case, both selectors will survive:

enabled "selector 1" Font A
disabled "selector 2" Font A

:)

troky’s picture

Status: Needs review » Fixed

LOL, didn't even checked that first patch. :)

Patch from #1 committed. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.