Skip to content

Commit e13402b

Browse files
Merge pull request #626 from summercms/PlayStation
Correct PlayStation brand name and add PS5
2 parents d4bd911 + 5e8cc47 commit e13402b

File tree

6 files changed

+140
-118
lines changed

6 files changed

+140
-118
lines changed

data/applications-browsers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
[ 'name' => 'Aplix', 'id' => 'aplix', 'regexp' =>'/Aplix_SEGASATURN_browser\/([0-9](?:.[0-9.]+)?)/u' ], // browser for the Sega Saturn
304304
[ 'name' => 'Bunjalloo', 'id' => 'bunjalloo', 'regexp' =>'/Bunjalloo\/([0-9.]*)/u' ], // browser for the Nintento DS
305305
[ 'name' => 'Nintendo Web Framework', 'id' => 'nwf', 'regexp' =>'/NWF\/([0-9.]*)/u', 'details' => 2 ], // browser for the Sega Dreamcast
306-
[ 'name' => 'Nuanti Meta', 'id' => 'nuanti', 'regexp' =>'/Nuanti(?:Meta)?\/([0-9.]*)/u' ], // browser for the Playstation
306+
[ 'name' => 'Nuanti Meta', 'id' => 'nuanti', 'regexp' =>'/Nuanti(?:Meta)?\/([0-9.]*)/u' ], // browser for the PlayStation
307307

308308
/* Other browsers */
309309
[ 'name' => 'Wear Internet Browser','id' => 'wib', 'regexp' =>'/WIB\/([0-9.]*)/u' ],

src/Analyser/Corrections.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ private function hideBrowserBasedOnOperatingSystem()
116116

117117
private function hideBrowserOnDeviceTypeGaming()
118118
{
119-
if (isset($this->data->device->model) && $this->data->device->model == 'Playstation 2' && $this->data->browser->name == 'Internet Explorer') {
119+
if (isset($this->data->device->model) && $this->data->device->model == 'PlayStation 2' && $this->data->browser->name == 'Internet Explorer') {
120120
$this->data->browser->reset();
121121
}
122122
}

src/Analyser/Header/Useragent/Browser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ private function detectNetfront($ua)
13651365
if (in_array($match[1], [ 'ACCESS/NFPS', 'SUNSOFT/EnjoyMagic' ])) {
13661366
$this->data->device->setIdentification([
13671367
'manufacturer' => 'Sony',
1368-
'model' => 'Playstation 2',
1368+
'model' => 'PlayStation 2',
13691369
'type' => Constants\DeviceType::GAMING,
13701370
'subtype' => Constants\DeviceSubType::CONSOLE
13711371
]);
@@ -2447,7 +2447,7 @@ private function detectTelevisionBrowsers($ua)
24472447
if (preg_match('/SPS/u', $ua, $match)) {
24482448
$this->data->device->setIdentification([
24492449
'manufacturer' => 'Sony',
2450-
'model' => 'Playstation 2',
2450+
'model' => 'PlayStation 2',
24512451
'type' => Constants\DeviceType::GAMING,
24522452
'subtype' => Constants\DeviceSubType::CONSOLE
24532453
]);

src/Analyser/Header/Useragent/Device/Gaming.php

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,39 +132,39 @@ private function detectPlaystation($ua)
132132

133133
$this->data->device->setIdentification([
134134
'manufacturer' => 'Sony',
135-
'model' => 'Playstation Portable',
135+
'model' => 'PlayStation Portable',
136136
'type' => Constants\DeviceType::GAMING,
137137
'subtype' => Constants\DeviceSubType::PORTABLE
138138
]);
139139
}
140140

141141
/* PlayStation Vita */
142142

143-
if (preg_match('/PlayStation Vita/iu', $ua)) {
143+
if (preg_match('/PlayStation Vita/ui', $ua)) {
144144
$this->data->os->reset();
145145
$this->data->os->identifyVersion('/PlayStation Vita ([0-9.]*)/u', $ua);
146146

147147
$this->data->device->setIdentification([
148148
'manufacturer' => 'Sony',
149-
'model' => 'Playstation Vita',
149+
'model' => 'PlayStation Vita',
150150
'type' => Constants\DeviceType::GAMING,
151151
'subtype' => Constants\DeviceSubType::PORTABLE
152152
]);
153153

154154
if (preg_match('/VTE\//u', $ua)) {
155-
$this->data->device->model = 'Playstation TV';
155+
$this->data->device->model = 'PlayStation TV';
156156
$this->data->device->subtype = Constants\DeviceSubType::CONSOLE;
157157
}
158158
}
159159

160160
/* PlayStation 2 */
161161

162-
if (preg_match('/Playstation2/u', $ua) || preg_match('/\(PS2/u', $ua)) {
162+
if (preg_match('/PlayStation2/ui', $ua) || preg_match('/\(PS2/u', $ua)) {
163163
$this->data->os->reset();
164164

165165
$this->data->device->setIdentification([
166166
'manufacturer' => 'Sony',
167-
'model' => 'Playstation 2',
167+
'model' => 'PlayStation 2',
168168
'type' => Constants\DeviceType::GAMING,
169169
'subtype' => Constants\DeviceSubType::CONSOLE
170170
]);
@@ -184,7 +184,7 @@ private function detectPlaystation($ua)
184184

185185
$this->data->device->setIdentification([
186186
'manufacturer' => 'Sony',
187-
'model' => 'Playstation 3',
187+
'model' => 'PlayStation 3',
188188
'type' => Constants\DeviceType::GAMING,
189189
'subtype' => Constants\DeviceSubType::CONSOLE
190190
]);
@@ -198,7 +198,21 @@ private function detectPlaystation($ua)
198198

199199
$this->data->device->setIdentification([
200200
'manufacturer' => 'Sony',
201-
'model' => 'Playstation 4',
201+
'model' => 'PlayStation 4',
202+
'type' => Constants\DeviceType::GAMING,
203+
'subtype' => Constants\DeviceSubType::CONSOLE
204+
]);
205+
}
206+
207+
/* PlayStation 5 */
208+
209+
if (preg_match('/PlayStation 5/ui', $ua) || preg_match('/\(PS5/u', $ua)) {
210+
$this->data->os->reset();
211+
$this->data->os->identifyVersion('/PlayStation 5 ([0-9.]*)/u', $ua);
212+
213+
$this->data->device->setIdentification([
214+
'manufacturer' => 'Sony',
215+
'model' => 'PlayStation 5',
202216
'type' => Constants\DeviceType::GAMING,
203217
'subtype' => Constants\DeviceSubType::CONSOLE
204218
]);

0 commit comments

Comments
 (0)