Home » Console » Console_Getopt » Bug #1831
Does not support = sign in argument value on longoptions
Details
| Submitted | 2004-07-09 11:37 UTC |
|---|---|
| From | leening at dauphin-mm dot nl |
| Assigned | andrei |
| Status | Closed |
| Package | Console_Getopt |
| PHP Version | 4.3.4 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-07-09 11:37 UTC] leening at dauphin-mm dot nl
Description:
------------
Does not support = sign in argument value on longoptions
ie: --mydn="dn=foo,ou=Bar,o=My Bar Org,c=NL"
In this case the value for the option 'mydn' becomes 'dn'
Reproduce code:
---------------
--- Getopt.php 2004-07-09 13:29:37.000000000 +0200
+++ Getopt.php.org 2004-07-09 13:34:56.000000000 +0200
@@ -184,7 +184,7 @@
*/
function _parseLongOption($arg, $long_options, &$opts, &$args)
{
- @list($opt, $opt_arg) = explode('=', $arg, 2);
+ @list($opt, $opt_arg) = explode('=', $arg);
$opt_len = strlen($opt);
for ($i = 0; $i < count($long_options); $i++) {
Expected result:
----------------
See patch which fixes the bug
Actual result:
--------------
See patch which fixes the bug