ZF-8056: View Helper HeadStyle does not accept comma separated strings with spaces for media attribute

Issue Type: Bug Created: 2009-10-12T13:49:05.000+0000 Last Updated: 2009-10-16T06:37:53.000+0000 Status: Resolved Fix version(s): - 1.9.5 (27/Oct/09)

Reporter: Travis Pew (travisp) Assignee: Stefan Gehrig (sgehrig) Tags: - Zend_View

Related issues: Attachments: - HeadStyleCommaSeparatedMediaAttribute.diff


When using headStyle, the media attribute works when set to 'screen,projection' or array('screen', 'projection') but not 'screen, projection' (with a space).

This is inconsistent with headLink which accepts the space, and the css specifications which allow the space:

This is because, unlike headLink, headStyle for some reason checks the media types specified, and retrieves them from the string using explode (which will leave extra spaces). This also means that headLink and headStyle treat the media attribute differently in another way (headLink allows any media type, headStyle only allows those specified in its code).


Posted by Travis Pew (travisp) on 2009-10-12T13:50:54.000+0000

A patch that would allow spaces in the comma separated media attribute and a unit test to make sure that it works.

I wonder though if it wouldn't be better to just make headStyle work entirely like headLink and not check against the list of "allowed" media types because CSS3 allows media to be specified as follows: "screen, 3d-glasses, print and resolution > 90dpi"

Posted by Stefan Gehrig (sgehrig) on 2009-10-16T06:37:53.000+0000

Fixed in trunk (r18571) and in 1.9-release branch (r18572)

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.