Skip to content

Commit d358a3d

Browse files
committed
Some markup fixes
1 parent 14c7112 commit d358a3d

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
root = true
2+
3+
[*.{php,js,html,css}]
4+
charset = utf-8
5+
indent_style = tab
6+
indent_size = 4
7+
trim_trailing_whitespace = true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ Benchmarking was performed on a low-level shared hosting.\
362362
Test server configuration: RedHat Linux + LiteSpeed + PHP Extension.\
363363
Test conditions based on collection of random ~446000 non repeated real life User-Agent strings.
364364

365-
Recognition performance PHP v5.3 (Requests Per Second):
365+
Recognition performance in the different PHP versions (Requests Per Second):
366366

367367
`Benchmark PHP 5.3:`
368368

src/BrowserDetection.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ private function matching_ua($data, $case_s)
7373

7474
if (substr($data, 0, 1)==='/' && substr($data, -1)==='/')
7575
{
76-
//echo $data."<br>";
7776
if ($case_s == FALSE) $data = $data.'i';
7877
if (preg_match($data, $this->useragent, $matches))
7978
{
@@ -89,19 +88,18 @@ private function matching_ua($data, $case_s)
8988
}
9089
else
9190
{
92-
$data_a = explode('|', $data);
93-
foreach ($data_a as $v)
94-
{
95-
//echo $v."<br>";
96-
if ($case_s == TRUE)
97-
{
98-
if (strpos($this->useragent, $v) !== FALSE) return TRUE;
99-
}
100-
else
101-
{
102-
if (stripos($this->useragent, $v) !== FALSE) return TRUE;
103-
}
104-
}
91+
$data_a = explode('|', $data);
92+
foreach ($data_a as $v)
93+
{
94+
if ($case_s == TRUE)
95+
{
96+
if (strpos($this->useragent, $v) !== FALSE) return TRUE;
97+
}
98+
else
99+
{
100+
if (stripos($this->useragent, $v) !== FALSE) return TRUE;
101+
}
102+
}
105103
}
106104

107105
return FALSE;
@@ -478,7 +476,7 @@ private function getResult()
478476
if ($os_need_continue && $this->result_ios!=FALSE && !$this->match_ua('Windows Phone|Windows Mobile'))
479477
{
480478
$this->result_os_version = 0;
481-
$this->result_os_name = 'iOS';
479+
$this->result_os_name = 'iOS';
482480
$matches = $this->match_ua('/\sOS\s(\d+)[_.](\d+)/');
483481
$version = $matches[1];
484482
$version_minor = $matches[2];

0 commit comments

Comments
 (0)