mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 00:06:55 +02:00
Fix issue processwire/processwire-issues#680 where ProcessLanguageTranslator does not skip over /site/assets/ on Windows servers
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user