aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Request.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Minz/Request.php')
-rw-r--r--lib/Minz/Request.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php
index 95cb220bf..c5adb02e1 100644
--- a/lib/Minz/Request.php
+++ b/lib/Minz/Request.php
@@ -306,7 +306,7 @@ class Minz_Request {
return false;
}
$host = parse_url($address, PHP_URL_HOST);
- if (!$host) {
+ if (!is_string($host)) {
return false;
}
@@ -358,7 +358,7 @@ class Minz_Request {
$notif = null;
Minz_Session::lock();
$requests = Minz_Session::param('requests');
- if ($requests) {
+ if (is_array($requests)) {
//Delete abandoned notifications
$requests = array_filter($requests, static function (array $r) { return isset($r['time']) && $r['time'] > time() - 3600; });
@@ -454,7 +454,7 @@ class Minz_Request {
* @return array<string>
*/
public static function getPreferredLanguages(): array {
- if (preg_match_all('/(^|,)\s*(?P<lang>[^;,]+)/', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '', $matches)) {
+ if (preg_match_all('/(^|,)\s*(?P<lang>[^;,]+)/', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '', $matches) > 0) {
return $matches['lang'];
}
return array('en');