projects
/
php-utility-classes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e446b9c
)
make sure we don't get a null uastring
master
author
Robert Kaiser
<kairo@kairo.at>
Sun, 3 Nov 2024 00:06:21 +0000
(
01:06
+0100)
committer
Robert Kaiser
<kairo@kairo.at>
Sun, 3 Nov 2024 00:06:34 +0000
(
01:06
+0100)
classes/useragent.php-class
patch
|
blob
|
blame
|
history
diff --git
a/classes/useragent.php-class
b/classes/useragent.php-class
index 190e539119befaa46f1f2b2c569170ba1111147a..c64117f38e8e3639fdf2912e797eefd9550f99f6 100755
(executable)
--- a/
classes/useragent.php-class
+++ b/
classes/useragent.php-class
@@
-106,11
+106,12
@@
class userAgent {
}
else {
// read raw UA string
}
else {
// read raw UA string
- $this->uastring =
$_SERVER['HTTP_USER_AGENT']
;
+ $this->uastring =
($_SERVER['HTTP_USER_AGENT'] ?? '')
;
}
// get UA brand and version
}
// get UA brand and version
- $this->brand = 'Unknown'; $this->version = null;
+ $this->brand = 'Unknown';
+ $this->version = null;
// find reasonable defaults
if (preg_match('|([0-9a-zA-Z\.:()_ -]+)/(\d[0-9a-zA-Z\._+-]*)|', $this->uastring, $regs)) {
$this->brand = trim($regs[1]);
// find reasonable defaults
if (preg_match('|([0-9a-zA-Z\.:()_ -]+)/(\d[0-9a-zA-Z\._+-]*)|', $this->uastring, $regs)) {
$this->brand = trim($regs[1]);