[thrift] Fix extension deserialization call with no classname
authordweatherford <dev-null@apache.org>
Fri, 16 Nov 2007 03:29:47 +0000 (03:29 +0000)
committerdweatherford <dev-null@apache.org>
Fri, 16 Nov 2007 03:29:47 +0000 (03:29 +0000)
Summary: The extension expects a classname as a string and does not allow null;
  use the empty string instead of null in the absence of a classname to pass.

Reviewed By: mcslee
Test Plan: php -l
Revert: svn

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

lib/php/src/Thrift.php

index fdec97f..10728a1 100644 (file)
@@ -220,7 +220,7 @@ class TException extends Exception {
         if ($ftype == $fspec['type']) {
           $xfer = 0;
           if ($fast_binary) {
-            $class = isset($fspec['class']) ? $fspec['class'] : null;
+            $class = isset($fspec['class']) ? $fspec['class'] : '';
             $this->$var = thrift_protocol_binary_deserialize($ftype, $input, $class);
           } else {
             if (isset(TBase::$tmethod[$ftype])) {
@@ -567,7 +567,7 @@ abstract class TBase {
         if ($ftype == $fspec['type']) {
           $xfer = 0;
           if ($fast_binary) {
-            $class = isset($fspec['class']) ? $fspec['class'] : null;
+            $class = isset($fspec['class']) ? $fspec['class'] : '';
             $this->$var = thrift_protocol_binary_deserialize($ftype, $input, $class);
           } else {
             if (isset(TBase::$tmethod[$ftype])) {