(bug 9575) Accept upload description from GET parameters
[lhc/web/wiklou.git] / includes / proxy_check.php
index 1ed54c8..a878a25 100644 (file)
@@ -1,15 +1,26 @@
 <?php
+/**
+ * Command line script to check for an open proxy at a specified location
+ */
 
-# Command line script to check for an open proxy at a specified location
-
-# Exit if there are not enough parameters, or if it's not command line mode
+if( php_sapi_name() != 'cli' ) {
+       die( 1 );
+}
 
+/**
+ *
+ */
 $output = '';
+
+/**
+ * Exit if there are not enough parameters, or if it's not command line mode
+ */
 if ( ( isset( $_REQUEST ) && array_key_exists( 'argv', $_REQUEST ) ) || count( $argv ) < 4 ) {
        $output .= "Incorrect parameters\n";
 } else {
-
-       # Get parameters
+       /**
+        * Get parameters
+        */
        $ip = $argv[1];
        $port = $argv[2];
        $url = $argv[3];
@@ -40,4 +51,4 @@ $output = escapeshellarg( $output );
 
 #`echo $output >> /home/tstarling/open/proxy.log`;
 
-?>
+