ZF-2471: Add isFlashRequest() to Zend_Controller_Request_Http

Issue Type: New Feature Created: 2008-01-24T03:26:21.000+0000 Last Updated: 2008-08-06T03:01:24.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Jack Sleight (jacksleight) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Controller

Related issues: - ZF-3866



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:

<pre class="highlight">
public function isFlashRequest()
    return ($this->getHeader('USER_AGENT') == 'Shockwave Flash');


Posted by Matthew Weier O'Phinney (matthew) on 2008-02-14T11:19:36.000+0000

Scheduling for 1.5 release

Posted by Matthew Weier O'Phinney (matthew) on 2008-02-20T15:12:09.000+0000

Added in current trunk.

Posted by C Snover (snover) on 2008-07-05T15:20:53.000+0000

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:

<pre class="highlight">
return (bool) preg_match('/flash player|shockwave flash/i', $this->getHeader('USER_AGENT'));

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.