Commit cddf691c by Carsten Brandt

made gii getManifest more robust against corrupt index file

parent 2df21b35
......@@ -7,6 +7,7 @@ Yii Framework 2 debug extension Change Log
- Bug #5402: Debugger was not loading when there were closures in asset classes (samdark)
- Bug #5745: Gii and debug modules may cause 404 exception when the route contains dashes (qiangxue)
- Enh #5600: Allow configuring debug panels in `yii\debug\Module::panels` as panel class name strings (qiangxue)
- Enh: Made `DefaultController::getManifest()` more robust against corrupt files (cebe)
2.0.0 October 12, 2014
......
......@@ -118,8 +118,8 @@ class DefaultController extends Controller
clearstatcache();
}
$indexFile = $this->module->dataPath . '/index.data';
if (is_file($indexFile) && is_readable($indexFile)) {
$this->_manifest = array_reverse(unserialize(file_get_contents($indexFile)), true);
if (is_file($indexFile) && is_readable($indexFile) && ($content = file_get_contents($indexFile)) !== false) {
$this->_manifest = array_reverse(unserialize($content), true);
} else {
$this->_manifest = [];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment