1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 08:17:12 +02:00

Fix issue processwire/processwire-issues#679 capture Exception in ProcessLanguageTranslator when it throws due to too many directories

This commit is contained in:
Ryan Cramer
2018-09-13 06:12:13 -04:00
parent 468ecb6b29
commit adca762ee1

View File

@@ -658,8 +658,17 @@ class ProcessLanguageTranslator extends Process {
$find1 = array('$this->_(', '$this->_n(', '$this->_x(');
$find2 = array('__(', '_n(', '_x(');
try {
$dirIterator = new \DirectoryIterator($path);
} catch(\Exception $e) {
$this->warning($e->getMessage());
$dirIterator = false;
}
if(!$dirIterator) return array();
foreach(new \DirectoryIterator($path) as $file) {
foreach($dirIterator as $file) {
if($file->isDot()) continue;
if(substr($file->getBasename(), 0, 1) == '.') continue; // skip hidden;