ZF-6637: headMeta() making PHP fatal error

Description

An exception is thrown in __toString() which is forbidden by PHP behavior (resulting in a PHP fatal error)

Use case :


echo $this->headMeta('some content','tag value','not-allowed-tag-name');

headMeta's toString() calls for itemToString() which then check the tag name. If it doesn't exist, it throws an exception (in the headMeta's case, only 'http-equip' is allowed as a tag name).

I suggest that instead of throwing an exception, it should return an empty string, resulting in no tag printed instead of a PHP fatal error. We could also tranform the exception in PHP Warning as a second solution.

What do you think ?

Comments

fixed at r16026