X-Git-Url: https://git.cweiske.de/linksys-wrt3g-tools.git/blobdiff_plain/9165313ca9a13caf0fa3a5c9d69be622ce7cf1b3..215db5cc36e14991194acf073de57656a0b52eff:/Wrt3g/HtmlParser.php diff --git a/Wrt3g/HtmlParser.php b/Wrt3g/HtmlParser.php index 17b46e5..ac4db35 100644 --- a/Wrt3g/HtmlParser.php +++ b/Wrt3g/HtmlParser.php @@ -36,8 +36,10 @@ class Wrt3g_HtmlParser * * @param string $body HTML document to parse * - * @return array Array of key-value pairs, probably with "type", "network" and - * "signal strength" + * @return array Array of key-value pairs, probably with + * - "type" + * - "network" + * - "signal strength" */ public function index_wstatus1($body) { @@ -100,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 @@ -126,6 +131,8 @@ class Wrt3g_HtmlParser * - card revision * - card firmware * - IMSI + * + * @todo FIXME implement "connection" value as index_wstatus2() does it */ public function status_noauth($body) {