Skip to content

Commit d5f24a6

Browse files
author
Tibor Barna
committed
Removed notice from Parser caused by undefined offset on line 323
1 parent 30c4c33 commit d5f24a6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Parser.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,16 @@ public function parse($useragent)
317317
$r=$q->fetchArray(SQLITE3_ASSOC);
318318
$qType = $this->dbdat->query("SELECT name FROM c_browser_type WHERE type=".$r["type"]." ");
319319
$rType=$qType->fetchArray(SQLITE3_ASSOC);
320-
320+
321+
$ua_ver = isset($result[1]) ? $result[1] : "";
322+
$ua_name = $r["name"];
323+
if (!empty($ua_ver)){
324+
$ua_name .= " " . $ua_ver;
325+
}
326+
321327
$info["type"] = $rType["name"];
322-
$info["ua_name"] = $r["name"]." ".$result[1];
323-
$info["ua_ver"] = $result[1];
328+
$info["ua_name"] = $ua_name;
329+
$info["ua_ver"] = $ua_ver;
324330
$info["ua_family"] = $r["name"];
325331
$info["ua_url"] = $r["url"];
326332
$info["ua_company"] = $r["company"];
@@ -905,4 +911,4 @@ protected function validIP($ip) {
905911
}
906912
}
907913

908-
}
914+
}

0 commit comments

Comments
 (0)