]> git.mxchange.org Git - core.git/blobdiff - inc/classes/third_party/api/wernisportal/class_WernisApi.php
Use array_push() instead of []
[core.git] / inc / classes / third_party / api / wernisportal / class_WernisApi.php
index d2e105488c8b40ca83ce8e40e09223de992a9106..45c42f18413afc0607b16474389f70afd90b1bcd 100644 (file)
@@ -392,7 +392,7 @@ class WernisApi extends BaseFrameworkSystem {
                // Generate request header
                $request  = "GET /".trim($script)." HTTP/1.0\r\n";
                $request .= "Host: ".$host."\r\n";
                // Generate request header
                $request  = "GET /".trim($script)." HTTP/1.0\r\n";
                $request .= "Host: ".$host."\r\n";
-               $request .= sprintf("User-Agent: Bube oder Dame / 1.0 by Quix0r [Spieler: %d]\r\n\r\n", $this->w_id);
+               $request .= sprintf("User-Agent: WernisApi/1.0 by Quix0r [Spieler: %d]\r\n\r\n", $this->w_id);
 
                // Initialize array
                $response = array();
 
                // Initialize array
                $response = array();
@@ -402,17 +402,17 @@ class WernisApi extends BaseFrameworkSystem {
 
                // Read response
                while(!feof($fp)) {
 
                // Read response
                while(!feof($fp)) {
-                       $response[] = trim(fgets($fp, 1024));
-               }
+                       array_push($response, trim(fgets($fp, 1024)));
+               } // END - while
 
                // Close socket
                fclose($fp);
 
                // Was the request successfull?
 
                // Close socket
                fclose($fp);
 
                // Was the request successfull?
-               if ((!ereg("200 OK", $response[0])) && (empty($response[0]))) {
+               if ((!ereg('200 OK', $response[0])) && (empty($response[0]))) {
                        // Not found / access forbidden
                        $response = array('', '', '');
                        // Not found / access forbidden
                        $response = array('', '', '');
-               }
+               } // END - if
 
                // Return response
                return $response;
 
                // Return response
                return $response;