Zend Framework

headMeta() making PHP fatal error

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.1
  • Fix Version/s: 1.8.4
  • Component/s: Zend_View
  • Labels:
    None

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 <meta> 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 ?

Activity

Hide
julien PAULI added a comment -

fixed at r16026

Show
julien PAULI added a comment - fixed at r16026

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: