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 90808c385a2b778e578558e59f80d1acdd3e874b..ac4db350a799090b5698fba62f5e1c350c6c3630 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