mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
[ticket/11927] Correctly add new files on update
Currently we ignore language and style files when the directory where they go to do not exist. However in 3.1 we introduce some new sub directories: * language/en/email/short/ * styles/prosilver/theme/en/ So we need to change our check to look whether the language or style exist, rather then the parent directory. PHPBB3-11927
This commit is contained in:
@@ -533,3 +533,42 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_test
|
||||
|
||||
return $config_data;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
function ignore_new_file_on_update($phpbb_root_path, $file)
|
||||
{
|
||||
$ignore_new_file = false;
|
||||
|
||||
// We ignore new files in some circumstances:
|
||||
// 1. The file is a language file, but the language is not installed
|
||||
if (!$ignore_new_file && strpos($file, 'language/') === 0)
|
||||
{
|
||||
list($language_dir, $language_iso) = explode('/', $file);
|
||||
$ignore_new_file = !file_exists($phpbb_root_path . $language_dir . '/' . $language_iso);
|
||||
}
|
||||
|
||||
// 2. The file is a style file, but the style is not installed
|
||||
if (!$ignore_new_file && strpos($file, 'styles/') === 0)
|
||||
{
|
||||
list($styles_dir, $style_name) = explode('/', $file);
|
||||
$ignore_new_file = !file_exists($phpbb_root_path . $styles_dir . '/' . $style_name);
|
||||
}
|
||||
|
||||
// 3. The file is a style language file, but the language is not installed
|
||||
if (!$ignore_new_file && strpos($file, 'styles/') === 0)
|
||||
{
|
||||
$dirs = explode('/', $file);
|
||||
if ($dirs >= 5)
|
||||
{
|
||||
list($styles_dir, $style_name, $template_component, $language_iso) = explode('/', $file);
|
||||
if ($template_component == 'theme' && $language_iso !== 'images')
|
||||
{
|
||||
$ignore_new_file = !file_exists($phpbb_root_path . 'language/' . $language_iso);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $ignore_new_file;
|
||||
}
|
||||
|
Reference in New Issue
Block a user