]> git.mxchange.org Git - core.git/blobdiff - inc/classes/third_party/api/wernisportal/class_WernisApi.php
'public static final' is correct
[core.git] / inc / classes / third_party / api / wernisportal / class_WernisApi.php
index 9ea8e54b01be8d70695225e4b88834f0a6a9820f..3c8d700512d17554551f35e9b7e0521d06fb299e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -78,7 +78,7 @@ class WernisApi extends BaseFrameworkSystem {
         * @param       $cfg                    Configuration array
         * @return      $apiInstance    An instance of this API class
         */
-       public final static function createWernisApi (array $cfg) {
+       public static final function createWernisApi (array $cfg) {
                // Create a new instance
                $apiInstance = new WernisApi();
 
@@ -218,7 +218,13 @@ class WernisApi extends BaseFrameworkSystem {
                }
 
                // All (maybe) fine so remove the response header from server
-               $response = $response[(count($response) - 1)];
+               for ($idx = (count($response) - 1); $idx > 1; $idx--) {
+                       $line = trim($response[$idx]);
+                       if (!empty($line)) {
+                               $response = $line;
+                               break;
+                       }
+               }
 
                // Prepare the returning result for higher functions
                if (substr($response, 0, 1) == '&') {