fix E_NOTICE when parsing empty html
authorChristian Weiske <cweiske@cweiske.de>
Thu, 16 Dec 2010 17:59:00 +0000 (18:59 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 16 Dec 2010 17:59:00 +0000 (18:59 +0100)
Wrt3g/HtmlParser.php

index 90808c3..ac4db35 100644 (file)
@@ -102,6 +102,9 @@ class Wrt3g_HtmlParser
     public function index_wstatus2($body)
     {
         preg_match('/var status2 = "(.+)"/', $body, $arMatches);
+        if (!isset($arMatches[1])) {
+            return array();
+        }
 
         $strStatus = $arMatches[1];
         //Connecting