]> granicus.if.org Git - php/commitdiff
That will really avoid PHP warnings
authorTomas V.V.Cox <cox@php.net>
Thu, 6 Jun 2002 06:40:05 +0000 (06:40 +0000)
committerTomas V.V.Cox <cox@php.net>
Thu, 6 Jun 2002 06:40:05 +0000 (06:40 +0000)
pear/PEAR/Command/Common.php

index e57d2796990d18e2faa869d3d8f682e3852a2fc5..e2d7a34dc6e6ae03527d760a5c2ff9223b7a6134 100644 (file)
@@ -174,10 +174,10 @@ class PEAR_Command_Common extends PEAR
             foreach ($this->commands[$command]['options'] as $k => $v) {
                 if (isset($v['shortopt'])) {
                     $s = $v['shortopt'];
-                    if (@$s{1} == ':') {
+                    if (strlen($s) > 1 && $s{1} == ':') {
                         $argname = '';
                         $optional = false;
-                        if (@$s{2} == ':') {
+                        if (strlen($s) > 2 && $s{2} == ':') {
                             $optional = true;
                             $argname = substr($s, 3);
                         } else {