Issue Type: Bug Created: 2009-12-21T21:00:39.000+0000 Last Updated: 2012-11-20T21:38:11.000+0000 Status: Open Fix version(s): Reporter: Steven Brown (monaro) Assignee: None Tags: - Zend_Json_Server
Related issues: Attachments: - Zend_Json_Server_Request.txt
-- Steven Brown email@example.com wrote (on Monday, 21 December 2009, 02:42 PM +1000):
I'm implemented a JSON-RPC server, but I've been snagged.
The namespace I want to use starts with a number.
This namespace does not pass the regular expressions that validate the namespaces in Zend_Json_Server_Smd_Service and Zend_Json_Server_Request, as a result the JSON-RPC server does not work.
If I remove the regular expression checks the code all works fine.
Given that namespaces starting with numbers are allowed in JSON-RPC, why are they being blocked in Zend_Json_Server?
Please don't suggest that I use a different namespace, due to forces outside of my control this would be a major headache.
Actually, there's really no reason to do so. My original thought on the matter was that it was a PHP limitation -- that we were mapping namespaces directly to PHP classes as a 1:1 mapping. However, that's not the case -- the namespace maps to a class, but they do not have to match.
Please file an issue in the tracker for this. In the meantime, simply extend Zend_Json_Server locally, and override the method that does the namespace check.
-- Matthew Weier O'Phinney Project Lead | firstname.lastname@example.org Zend Framework | http://framework.zend.com/
Posted by Steven Brown (monaro) on 2010-01-11T23:16:56.000+0000
--- library/Zend/Json/Server/Request.php (revision 20162) +++ library/Zend/Json/Server/Request.php (working copy) @@ -51,7 +51,7 @@ * Regex for method * @var string / - protected $methodRegex = '/^[a-z][a-z0-9.]$/i'; + protected $methodRegex = '/^[a-z0-9][a-z0-9.]*$/i';
/** * Request parameters
--- library/Zend/Json/Server/Smd/Service.php (revision 20162) +++ library/Zend/Json/Server/Smd/Service.php (working copy) @@ -58,7 +58,7 @@ * Regex for names * @var string */ - protected $_nameRegex = '/^[a-z][a-z0-9._]+$/i'; + protected $_nameRegex = '/^[a-z0-9][a-z0-9._]+$/i';
/** * Parameter option types
Posted by Steven Brown (monaro) on 2010-01-11T23:18:48.000+0000
Sorry, seems patches in comments don't work
Have you found an issue?
See the Overview section for more details.