What are the steps required to reproduce the bug?

When a link is created using the l() function and the 'class' key of the 'attributes' in the options parameter has not been set and the link path is the active url, PHP errors out stating that it failed to assign [] to a string value in common.inc on line 2445.

What behavior were you expecting?

I was expecting no errors and the link to have the class 'active'

What happened instead?

PHP errors out stating that it failed to assign [] to a string value in common.inc on line 2445.

Comments

curiosity26’s picture

The following patch asserts that $options['attributes']['class'] is an array.

Version: 7.25 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Needs review » 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.