Skip to content
This repository has been archived by the owner on Nov 30, 2017. It is now read-only.

Commit

Permalink
Built WhichBrowser from commit 42ef132 on branch dev
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsLeenheer committed Nov 6, 2015
1 parent 9fc2e74 commit c7a2d46
Show file tree
Hide file tree
Showing 7 changed files with 223 additions and 46 deletions.
88 changes: 50 additions & 38 deletions data/models-android.php

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion data/models-feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@
'SGH-G600' => array( 'Samsung', 'G600' ),
'SGH-S390G' => array( 'Samsung', 'S390 TracFone' ),
'SGH-T189N' => array( 'Samsung', 'Freeform M'),
'SM-B313E' => array( 'Samsung', 'Metro 313' ),
'SM-B350E' => array( 'Samsung', 'Metro 350' ),
'SM-B780(A|W)!' => array( 'Samsung', 'Rugby 4' ),
'S7350' => array( 'Samsung', 'S7350 Ultra S' ),
'Vodafone 575' => array( 'Vodafone', '575' ),
'GT-I6410' => array( 'Vodafone', '360 M1' ),
);
);
1 change: 1 addition & 0 deletions data/models-firefoxos.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'LG-D300' => array( 'LG', 'Fireweb' ),
'LGL25' => array( 'LG', 'Fx0' ),
'madai' => array( 'LG', 'Fx0' ),
'Orange KLIF' => array( 'Orange', 'Kilf' ),
'Orange KLIFD' => array( 'Orange', 'Kilf' ),
'OPEN' => array( 'ZTE', 'Open' ),
'ZTEOPEN' => array( 'ZTE', 'Open' ),
Expand Down
5 changes: 3 additions & 2 deletions data/models-touchwiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'GT-S5292' => array( 'Samsung', 'Star Deluxe Duos' ),
'GT-S5560!' => array( 'Samsung', 'Marvel' ),
'GT-S5600' => array( 'Samsung', 'Preston' ),
'GT-S5603' => array( 'Samsung', 'Star 3G' ),
'GT-S5620!' => array( 'Samsung', 'Monte' ),
'GT-S5680' => array( 'Samsung', 'GT-S5680' ),
'GT-S7550' => array( 'Samsung', 'Blue Earth' ),
Expand All @@ -38,5 +39,5 @@
'SGH-A597' => array( 'Samsung', 'Eternity II' ),
'SGH-F480' => array( 'Samsung', 'Tocco' ),
'SGH-F480I' => array( 'Samsung', 'Tocco' ),
'SGH-T528g' => array( 'Samsung', 'Straight Talk' )
);
'SGH-T528g' => array( 'Samsung', 'Straight Talk' )
);
152 changes: 152 additions & 0 deletions data/profiles.php

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions detect.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
toJSON: function() {
return {
name: this.name,
alias: this.alias,
version: (this.version) ? this.version.toJSON() : null,
stock: this.stock,
channel: this.channel,
Expand Down
18 changes: 13 additions & 5 deletions libraries/whichbrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -4602,6 +4602,17 @@ function analyseUserAgent($ua) {
}
}

/****************************************************
* Edge
*/


if (preg_match('/Edge\/([0-9]+)/u', $ua, $match)) {
$this->browser->name = 'Edge';
$this->browser->alias = 'Edge ' . $match[1];
$this->browser->channel = '';
$this->browser->version = null;
}

/****************************************************
* Opera
Expand Down Expand Up @@ -5954,11 +5965,6 @@ function analyseUserAgent($ua) {
}
}

if (preg_match('/Edge\/([0-9.]*)/u', $ua, $match)) {
$this->browser->name = 'Edge';
$this->browser->version = null;
}


if (isset($this->browser->name) && $this->browser->name == 'Opera' && $this->device->type == TYPE_TELEVISION) {
$this->browser->name = 'Opera Devices';
Expand Down Expand Up @@ -6212,6 +6218,7 @@ function toArray() {
if (isset($this->browser)) {
$result['browser'] = array();
if (isset($this->browser->name) && $this->browser->name) $result['browser']['name'] = $this->browser->name;
if (isset($this->browser->alias) && $this->browser->alias) $result['browser']['alias'] = $this->browser->alias;
if (isset($this->browser->version) && $this->browser->version) $result['browser']['version'] = $this->browser->version->toArray();
}

Expand All @@ -6224,6 +6231,7 @@ function toArray() {
if (isset($this->os)) {
$result['os'] = array();
if (isset($this->os->name) && $this->os->name) $result['os']['name'] = $this->os->name;
if (isset($this->os->alias) && $this->os->alias) $result['os']['alias'] = $this->os->alias;
if (isset($this->os->family) && $this->os->family) $result['os']['family'] = $this->os->family;
if (isset($this->os->version) && $this->os->version) $result['os']['version'] = $this->os->version->toArray();
}
Expand Down

0 comments on commit c7a2d46

Please sign in to comment.