Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297731

Avoiding Fatal Error on bad class array usage on links (used as string), when adding active class

$
0
0

When adding class as string instead of array the link theming seems to work, until the link point on the current page, ending ina wsod with message:

PHP Fatal error: [] operator not supported for strings in /www/includes/common.inc

This bug has been seen for example on core comments #1200478: Changing the comment path to the node path triggers a PHP fatal error in l() due to wrongly structured options , but is sometimes seen on other module and can hurt custom code quite easily (especially because the wsod happens only when adding active on the link.

So I'd like to avoid wsod on websites where this link-to-current-page-with-bad-class attribute is set, but keeping an alert on bad usage for site maintainer, fixing the class attribute while sending a watchdog error. Patch attached on first comment.


Viewing all articles
Browse latest Browse all 297731

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>