avoid E_NOTICE if only one argument is given to the "get" command
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 14 Mar 2009 20:09:48 +0000 (20:09 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 14 Mar 2009 20:09:48 +0000 (20:09 +0000)
maintenance/mcc.php

index 8960587..53645df 100644 (file)
@@ -88,7 +88,11 @@ do {
                break;
 
                case 'get':
-                       print "Getting {$args[0]}[{$args[1]}]\n";
+                       $sub = '';
+                       if ( array_key_exists( 1, $args ) ) {
+                               $sub = $args[1];
+                       }
+                       print "Getting {$args[0]}[$sub]\n";
                        $res = $mcc->get( $args[0] );
                        if ( array_key_exists( 1, $args ) ) {
                                $res = $res[$args[1]];