[thrift] grrrr ... TPhpStream can read the string '0'
authoreletuchy <dev-null@apache.org>
Wed, 13 Feb 2008 22:41:03 +0000 (22:41 +0000)
committereletuchy <dev-null@apache.org>
Wed, 13 Feb 2008 22:41:03 +0000 (22:41 +0000)
    Summary: php sucks

    Reviewed By: mcslee

    Test Plan: thrift call with string '0' has same behavior as string '1'

    Revert Plan: sure

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665477 13f79535-47bb-0310-9956-ffa450edef68

lib/php/src/transport/TPhpStream.php

index d4646f1..d1350d7 100644 (file)
@@ -70,7 +70,7 @@ class TPhpStream extends TTransport {
 
   public function read($len) {
     $data = @fread($this->inStream_, $len);
-    if (!$data) {
+    if ($data === FALSE || $data === '') {
       throw new TException('TPhpStream: Could not read '.$len.' bytes');
     }
     return $data;