ZF-7016: Error Messages should not be in plain text it should be sent as a AMF message

Issue Type: Bug Created: 2009-06-14T23:22:47.000+0000 Last Updated: 2009-06-15T09:17:34.000+0000 Status: Resolved Fix version(s): Reporter: Sunil (sunilbg) Assignee: Wade Arnold (wadearnold) Tags: - Zend_Amf

Related issues: Attachments:


I have the following function which connects to my local mysql database and if you notice there is a syntax error in the SELECT query, it is missing the select list.

public function getItem($id) { $this->connect();

  $id = mysql_real_escape_string($id);
  $sql = "SELECT  FROM books where id=$id";
  $result = mysql_query($sql) or die('Query failed: ' . mysql_error());
  return $result;

Zend gives a nice error "Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM books where id=1' at line 1"

However other AMF implementations like ColdFusion, BlazeDS, LCDS give this error message as a AMF message and not as a plain text. When Flashplayer is expecting a AMF response it sees this plain text and tells this is not a valid AMF message and disconnects resulting in "Channel Disconnected" Error

Can Zend AMF send all error messages in AMF?


Posted by Stanislav Malyshev (stas) on 2009-06-15T09:16:25.000+0000

If you use die() it does just that - ends the script, and so AMF module could not process it. Replace die() with exception, that should be caught by the AMF module and returned as AMF message.

Have you found an issue?

See the Overview section for more details.


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

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