mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 00:37:02 +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:
@@ -659,7 +659,16 @@ class ProcessLanguageTranslator extends Process {
|
|||||||
$find1 = array('$this->_(', '$this->_n(', '$this->_x(');
|
$find1 = array('$this->_(', '$this->_n(', '$this->_x(');
|
||||||
$find2 = array('__(', '_n(', '_x(');
|
$find2 = array('__(', '_n(', '_x(');
|
||||||
|
|
||||||
foreach(new \DirectoryIterator($path) as $file) {
|
try {
|
||||||
|
$dirIterator = new \DirectoryIterator($path);
|
||||||
|
} catch(\Exception $e) {
|
||||||
|
$this->warning($e->getMessage());
|
||||||
|
$dirIterator = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$dirIterator) return array();
|
||||||
|
|
||||||
|
foreach($dirIterator as $file) {
|
||||||
|
|
||||||
if($file->isDot()) continue;
|
if($file->isDot()) continue;
|
||||||
if(substr($file->getBasename(), 0, 1) == '.') continue; // skip hidden;
|
if(substr($file->getBasename(), 0, 1) == '.') continue; // skip hidden;
|
||||||
|
Reference in New Issue
Block a user