Issues

ZF-2471: Add isFlashRequest() to Zend_Controller_Request_Http

Description

We already have an isXmlHttpRequest method, which is useful for detecting AJAX requests and returning different data (XML, JSON etc.) rather than HTML. However another common time when you'd probably rather return XML than HTML is if the request was made by a Flash movie, so I think an isFlashRequest method would be useful as well, like so:


public function isFlashRequest()
{
    return ($this->getHeader('USER_AGENT') == 'Shockwave Flash');
}

Comments

Scheduling for 1.5 release

Added in current trunk.

I've also seen Flash on non-Windows platforms use "Flash Player [version number]" as the User-Agent string. Didn't really think it was worth opening a new bug over, though. I'm using this now to match:


return (bool) preg_match('/flash player|shockwave flash/i', $this->getHeader('USER_AGENT'));