From 60d95f36c0081a03b947c2b625c10841bb19736c Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 11 Oct 2016 10:36:25 -0700 Subject: Fix the bug that message without namespace is not found in the descriptor pool. (#2240) --- php/src/Google/Protobuf/descriptor.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'php/src') diff --git a/php/src/Google/Protobuf/descriptor.php b/php/src/Google/Protobuf/descriptor.php index afe08227..e5cff0ba 100644 --- a/php/src/Google/Protobuf/descriptor.php +++ b/php/src/Google/Protobuf/descriptor.php @@ -240,9 +240,13 @@ function getFullClassName( $class_name_without_package = implode('_', array_map('ucwords', explode('.', $message_name_without_package))); - $classname = - implode('\\', array_map('ucwords', explode('.', $package))). - "\\".$class_name_without_package; + if ($package === "") { + $classname = $class_name_without_package; + } else { + $classname = + implode('\\', array_map('ucwords', explode('.', $package))). + "\\".$class_name_without_package; + } } class OneofDescriptor -- cgit v1.2.3