OSDN Git Service

fix edge case in guess_url()
authorscribu <mail@scribu.net>
Wed, 17 Jul 2013 00:29:13 +0000 (03:29 +0300)
committerscribu <mail@scribu.net>
Wed, 17 Jul 2013 00:29:32 +0000 (03:29 +0300)
php/WP_CLI/Runner.php

index 917f843..497208b 100644 (file)
@@ -129,10 +129,11 @@ class Runner {
                                }
                        }
 
-                       if ( !empty( $hit ) && isset( $hit['domain'] ) )
+                       if ( !empty( $hit ) && isset( $hit['domain'] ) ) {
                                $url = $hit['domain'];
-                       if ( !empty( $hit ) && isset( $hit['path'] ) )
-                               $url .= $hit['path'];
+                               if ( isset( $hit['path'] ) )
+                                       $url .= $hit['path'];
+                       }
                }
 
                if ( isset( $url ) ) {