aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/src
diff options
context:
space:
mode:
authorGravatar Paul Yang <TeBoring@users.noreply.github.com>2016-10-11 10:36:25 -0700
committerGravatar GitHub <noreply@github.com>2016-10-11 10:36:25 -0700
commit60d95f36c0081a03b947c2b625c10841bb19736c (patch)
tree18a505eb1da4f6072afb9344af72880f0d789d3a /php/src
parent0321baf9e855a2b664436605c7067f348e1d7284 (diff)
Fix the bug that message without namespace is not found in the descriptor pool. (#2240)
Diffstat (limited to 'php/src')
-rw-r--r--php/src/Google/Protobuf/descriptor.php10
1 files changed, 7 insertions, 3 deletions
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