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

Fix issue processwire/processwire-issues#680 where ProcessLanguageTranslator does not skip over /site/assets/ on Windows servers

This commit is contained in:
Ryan Cramer
2018-09-13 06:21:31 -04:00
parent adca762ee1
commit dfc0c4da52

View File

@@ -655,6 +655,8 @@ class ProcessLanguageTranslator extends Process {
$files = array();
$dirs = array();
$root = $this->wire('config')->paths->root;
$assetsDir = '/site/assets/';
if(DIRECTORY_SEPARATOR != '/') $assetsDir = str_replace('/', DIRECTORY_SEPARATOR, $assetsDir);
$find1 = array('$this->_(', '$this->_n(', '$this->_x(');
$find2 = array('__(', '_n(', '_x(');
@@ -674,7 +676,7 @@ class ProcessLanguageTranslator extends Process {
if(substr($file->getBasename(), 0, 1) == '.') continue; // skip hidden;
if($file->isDir()) {
$pathname = $file->getPathname();
if(strpos($pathname, '/site/assets/') !== false) continue; // avoid descending into /site/assets/
if(strpos($pathname, $assetsDir) !== false) continue; // avoid descending into /site/assets/
$dirs[] = $pathname;
continue;
}