Open manan-india opened 2 years ago
Hi! Could you please share more detailed steps to reproduce ?
Hello!
We have called the function of class(path: vendor/magento/zendframework1/library/Zend/Http/UserAgent/Mobile.php on line 33): This class is implementing the Serializable interface and it is deprecated in PHP 8.1: https://php.watch/versions/8.1/serializable-deprecated. Implementation:
public function isMobileDevice()
{
$userAgent = $this->httpHeader->getHttpUserAgent();
$server = $this->getRequest()->getServer();
$isMobileDevice = \Zend_Http_UserAgent_Mobile::match($userAgent, $server);
if (!$isMobileDevice) {
return true;
}
return false;
}
You can quickly fix it by commenting out Serialize in Device.php:
interface Zend_Http_UserAgent_Device //extends Serializable
or by adding the two Serialization methods in AbstractDevice.php: https://github.com/indrisepos/zf1/pull/1
When calling the match($userAgent, $server) function for mobile view in the module, it is giving error
PHP: 8.1 Magento: 2.4.4