From 2e3b2ac38fb42c0b685a0c345f7f42ac823d7748 Mon Sep 17 00:00:00 2001 From: gggeek Date: Sat, 30 May 2015 11:47:07 +0200 Subject: [PATCH] Fix: better generation of method signatures in wrap_php_ calls --- NEWS | 3 ++- src/Wrapper.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index d941bcf..8d8c130 100644 --- a/NEWS +++ b/NEWS @@ -60,7 +60,8 @@ PLEASE READ CAREFULLY THE NOTES BELOW to insure a smooth upgrade. * fixed: the debugger would fail sending a request with ISO-8859-1 payload (it missed the character set declaration). It would have a hard time coping with ISO-8859-1 in other fields, such as e.g. the remote method name -* fixed: the debugger would generate a bad payload via the 'load method synopsis' button for signatures containing NULLs +* fixed: the debugger would generate a bad payload via the 'load method synopsis' button for signatures containing NULL + or undefined parameters * fixed: the debugger would generate a bad payload via the 'load method synopsis' button for methods with multiple signatures diff --git a/src/Wrapper.php b/src/Wrapper.php index 21321a6..f7f2072 100644 --- a/src/Wrapper.php +++ b/src/Wrapper.php @@ -280,10 +280,10 @@ class Wrapper $desc .= $doc; } elseif (strpos($doc, '@param') === 0) { // syntax: @param type $name [desc] - if (preg_match('/@param\s+(\S+)\s+(\$\S+)\s+(.+)?/', $doc, $matches)) { + if (preg_match('/@param\s+(\S+)\s+(\$\S+)\s*(.+)?/', $doc, $matches)) { $name = strtolower(trim($matches[2])); //$paramDocs[$name]['name'] = trim($matches[2]); - $paramDocs[$name]['doc'] = $matches[3]; + $paramDocs[$name]['doc'] = isset($matches[3]) ? $matches[3] : ''; $paramDocs[$name]['type'] = $matches[1]; } $i++; -- 2.43.0