mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
test fixes
This commit is contained in:
parent
5de349ba68
commit
f83e60a592
|
|
@ -14,6 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Database;
|
||||
|
||||
use Mpdf\Tag\P;
|
||||
use phpOMS\DataStorage\Database\Connection\ConnectionAbstract;
|
||||
use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
|
||||
use phpOMS\DataStorage\Database\Connection\NullConnection;
|
||||
|
|
@ -74,11 +75,12 @@ final class DatabasePool implements DataStoragePoolInterface
|
|||
return new NullConnection();
|
||||
}
|
||||
|
||||
if (empty($key)) {
|
||||
return \reset($this->pool);
|
||||
$con = empty($key) ? \reset($this->pool) : $this->pool[$key];
|
||||
if ($con->status !== DatabaseStatus::OK) {
|
||||
$con->connect();
|
||||
}
|
||||
|
||||
return $this->pool[$key];
|
||||
return $con;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ final class HttpHeader extends HeaderAbstract
|
|||
*/
|
||||
public function getBrowserName() : string
|
||||
{
|
||||
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
||||
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
|
||||
|
||||
if (\strpos($userAgent, 'Opera') !== false || \strpos($userAgent, 'OPR/') !== false) {
|
||||
return 'Opera';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user