-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] latest 4.8.07 cause site error Call to a member function get() on false #974
Comments
same issue here. this is my log, i using laravel 10 and php 8.3
and my version also is |
@ziming how are you using this in Laravel? @samliu999 it looks that I've overlooked (also in the tests) the fact that the change from public function __construct(
Cache $cache = null,
array $config = [],
) { to
makes I will patch this asap |
I'm using it in Middleware check if IE then if it is IE redirect them to a page to upgrade their browser |
I had to delete |
released it again https://github.com/serbanghita/Mobile-Detect/releases/tag/4.8.07 let me know if you have issues |
Same here, 4.8.07 (installed using Composer) breaks everything: [09-Dec-2024 17:39:56 America/New_York] PHP Fatal error: Uncaught Error: Interface "Psr\Cache\CacheItemInterface" not found in /var/app/current/vendor/mobiledetect/mobiledetectlib/src/Cache/CacheItem.php:14 |
https://github.com/serbanghita/Mobile-Detect/releases/tag/4.8.08 I have somehow missed the Please check |
After removing the lock on 4.8.06 i composer update, deploy and almost right away my prod server receive 36 sentry errors The error is: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'key' at row 1 (Connection: mysql, SQL: insert into The cache table is from laravel I know your package is not for laravel so I'm not sure if your package should handle it or laravel side should handle it. For now i lock it back to 4.8.06 |
@ziming Great feedback! This is because by default I use |
cache keys are now by default encoded with <?php
require __DIR__ . '/vendor/autoload.php';
use Detection\MobileDetect;
$detect = new MobileDetect();
$detect->setUserAgent('Mozilla/5.0 (iPad; CPU OS 14_7 like Mac OS X) ...');
$isMobile = $detect->isMobile();
$isTablet = $detect->isTablet();
var_dump($isMobile);
var_dump($isTablet);
var_dump($detect->getCache()->getKeys());
|
@ziming what Laravel package are you using or you're injecting it manually? |
@serbanghita Thank you for providing the MobileDetect class. I'm not aware about where @ziming is using your class, but it is part of the laravel/jetstream extension (as I just run into the problems with 4.8.07 (Error: "Psr\Cache\CacheItemInterface not found") and fixed it by updating to 4.8.09) |
im aware jetstream is using it but the codebase where i got the error from is not using laravel jetstream hence why i haven't answer |
@ChrBad thanks for the update, yes I had a release problem with |
Describe the bug
After updating to the latest version. I keep get this error in Sentry and my site went down
Call to a member function get() on false
According to sentry, this is the line
$this->detect->isIE()
where detect is MobileDetect
User-agent/Device/Phone/Tablet (please complete the following information):
I'm also using Laravel 11 and php 8.3 latest version
The text was updated successfully, but these errors were encountered: