fixed coding fail
[ZNCAdmin.git] / zncadmin / ZNCServer.class.php
index f85dd5607848db4c340006978b1f0ef6e9fd9f0a..92e9c3f4da6dd15ee0eb6f08c43d419f765fe5d5 100644 (file)
@@ -1,19 +1,19 @@
 <?php
 /* ZNCServer.class.php - ZNC Server Class - ZNCAdmin
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
- * 
+ *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License 
- * along with this program. If not, see <http://www.gnu.org/licenses/>. 
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 define("ERR_OK", 0);
@@ -24,6 +24,7 @@ define("ERR_UNKNOWN_ZNC_VERSION_OR_METHOD", 4);
 
 $zncserver_classes = array(
        "ZNCServerV0.class.php",
+       "ZNCServerV1.class.php",
 );
 
 class ZNCServer {
@@ -44,7 +45,7 @@ class ZNCServer {
        public function ZNCServer($host, $port, $version = null) {
                $this->host = $host;
                $this->port = $port;
-               if(is_empty(self::$zncserver_classes))
+               if(empty(self::$zncserver_classes))
                        self::load_classes();
                if($version !== null) {
                        $this->loadServerObject($version);
@@ -81,7 +82,7 @@ class ZNCServer {
                $logged_in = !preg_match("/errorbar/i", $http);
                
                /* Version detection */
-               if(preg_match("ZNC ([0-9]+\.[0-9]+)", $http, $version_match))
+               if(preg_match("#ZNC ([0-9]+\.[0-9]+)#", $http, $version_match))
                        $this->loadServerObject($version_match[1], $connector);
                
                return $logged_in;