Skip to content

ICE_Option::format_style_selector() fails on some style_selectors #87

@boonebgorges

Description

@boonebgorges

When a style_selector does not contain a colon (like when it's 'body'), the following regex will only return a single match:

if ( preg_match( '/^(body[^:]*)(:[\w-]+)?/', $this->style_selector, $matches ) ) {

In these cases, $matches[2] is undefined (on the next line).

I'm not sure whether this causes any real problems - I'm not 100% sure what this method is supposed to be doing - but it does cause a PHP warning. Either you should fall through to the second condition ("not a body selector"), or provide a fallback value for the sprintf().

See cuny-academic-commons/cbox-theme#157, which I'm going to close.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions