How to fix unserialize(): Error at offset when downloading the PDF?

Download PDF file with Cyrillic, it comes out
PHP Notice yii\base\ErrorException with message unserialize(): Error at offset 7876608 of 5527 bytes in /var/www/www-root/data/www/2fraz.vadimtest.ru/vendor/yiisoft/yii2-debug/src/controllers/DefaultController.php:185

400 bad request.
A debug folder was deleted, did not help.
The method on which the error refers
public function loadData($tag, $maxRetry = 0)
{
 // retry loading debug data because the debug data is logged in shutdown function
 // which may be delayed in some environment if xdebug is enabled.
 // See: https://github.com/yiisoft/yii2/issues/1504
 for ($retry = 0; $retry <= $maxRetry; ++$retry) {
 $manifest = $this->getManifest($retry > 0);
 if (isset($manifest[$tag])) {
 $dataFile = $this->module->dataPath . "/$tag.data";
 $data = unserialize(file_get_contents($dataFile)); <----
 $exceptions = $data['exceptions'];
 foreach ($this->module->panels as $id => $panel) {
 if (isset($data[$id])) {
 $panel->tag = $tag;
$panel->load(unserialize($data[$id]));
}
 if (isset($exceptions[$id])) {
$panel->setError($exceptions[$id]);
}
}
 $this->summary = $data['summary'];

return;
}
sleep(1);
}

 throw new NotFoundHttpException("Unable to find debug data tagged with '$tag'.");
 }


Normal PDF with images loaded normally.
April 4th 20 at 13:06
1 answer
April 4th 20 at 13:08
$data = unserialize(file_get_contents($dataFile));
and then
unserialize($data[$id])
You want to ancellotti unserializable? To steal stolen? To drink drunk?

But error is not likely associated with a pdf coy. 400 error is no csrf token is likely.
Perhaps the developers of yii that is what I want :) - Armando_Hills commented on April 4th 20 at 13:11
@Armando_Hills,
here is the original:
https://github.com/yiisoft/yii2-debug/blob/master/...
don't see what you have, probably You have an older version

But I don't think the error is related to a pdf-which. 400 error is no csrf token is likely. - Avis commented on April 4th 20 at 13:14
@Avis, csrf're not exactly with it, but the package will try to upgrade, thanks for the tip - Armando_Hills commented on April 4th 20 at 13:17
@Avis, I updated the package yii2-debug, but still throws the error
yii\web\BadRequestHttpException: failed to validate the transmitted data. in /var/www/www-root/data/www/2fraz.vadimtest.ru/vendor/yiisoft/yii2/web/Controller.php:187

Well if it was csrf, other files are not loaded would be? - Armando_Hills commented on April 4th 20 at 13:20

Find more questions by tags Yii