Merge pull request #44 from djfm/feat/starter-theme

// cleaner way to suppress the notice
This commit is contained in:
François-Marie de Jouvencel
2015-09-25 16:53:43 +02:00
+6 -1
View File
@@ -958,7 +958,12 @@ class Blocktopmenu extends Module implements WidgetInterface
protected function clearMenuCache() protected function clearMenuCache()
{ {
$dir = $this->getCacheDirectory(); $dir = $this->getCacheDirectory();
foreach (@scandir($dir) as $entry) {
if (!is_dir($dir)) {
return;
}
foreach (scandir($dir) as $entry) {
if (preg_match('/\.json$/', $entry)) { if (preg_match('/\.json$/', $entry)) {
unlink($dir . DIRECTORY_SEPARATOR . $entry); unlink($dir . DIRECTORY_SEPARATOR . $entry);
} }