Fixed o_avatars_dir field validation
This commit is contained in:
parent
14b578d25a
commit
caa0f160da
3 changed files with 22 additions and 4 deletions
|
@ -145,7 +145,13 @@ class Options extends Admin
|
|||
*/
|
||||
public function vCheckDir(Validator $v, $dir)
|
||||
{
|
||||
$dir = '/' . \trim(\str_replace(['\\', '.', '//', ':'], ['/', '', '', ''], $dir), '/'); //?????
|
||||
$dir = '/' . \trim(\str_replace(['\\', '.', '//', ':'], ['/', '', '', ''], $dir), '/');
|
||||
|
||||
if (! \is_dir($dir)) {
|
||||
$v->addError('The folder for uploading avatars is incorrectly');
|
||||
} elseif (! \is_writable($dir)) {
|
||||
$v->addError('For PHP, it is forbidden to write in the folder for uploading avatars');
|
||||
}
|
||||
|
||||
return $dir;
|
||||
}
|
||||
|
@ -515,7 +521,7 @@ class Options extends Admin
|
|||
'maxlength' => '255',
|
||||
'value' => $config->o_avatars_dir,
|
||||
'caption' => __('Upload directory label'),
|
||||
'info' => __('Upload directory help'),
|
||||
'info' => __('Upload directory help', $this->c->PUBLIC_URL),
|
||||
'required' => true,
|
||||
],
|
||||
'i_avatars_width' => [
|
||||
|
|
|
@ -253,7 +253,7 @@ msgid "Upload directory label"
|
|||
msgstr "Upload directory"
|
||||
|
||||
msgid "Upload directory help"
|
||||
msgstr "The upload directory for avatars (relative to the ForkBB root directory). PHP must have write permissions to this directory."
|
||||
msgstr "The upload directory for avatars (relative to %s). PHP must have write permissions to this directory."
|
||||
|
||||
msgid "Max width label"
|
||||
msgstr "Max width"
|
||||
|
@ -446,3 +446,9 @@ msgstr "Result for guest"
|
|||
|
||||
msgid "Result for guest help"
|
||||
msgstr "The guests see the voting results."
|
||||
|
||||
msgid "The folder for uploading avatars is incorrectly"
|
||||
msgstr "The folder for uploading avatars is incorrectly."
|
||||
|
||||
msgid "For PHP, it is forbidden to write in the folder for uploading avatars"
|
||||
msgstr "For PHP, it is forbidden to write in the folder for uploading avatars."
|
||||
|
|
|
@ -253,7 +253,7 @@ msgid "Upload directory label"
|
|||
msgstr "Папка для загрузки"
|
||||
|
||||
msgid "Upload directory help"
|
||||
msgstr "Папка загрузки аватар (относительно корня форума). Необходимо дать PHP права на запись в эту папку."
|
||||
msgstr "Папка загрузки аватар (относительно %s). Необходимо дать PHP права на запись в эту папку."
|
||||
|
||||
msgid "Max width label"
|
||||
msgstr "Макс. ширина"
|
||||
|
@ -446,3 +446,9 @@ msgstr "Результат для гостя"
|
|||
|
||||
msgid "Result for guest help"
|
||||
msgstr "Гости видят результаты голосования."
|
||||
|
||||
msgid "The folder for uploading avatars is incorrectly"
|
||||
msgstr "Неправильно указана папка для аватарок."
|
||||
|
||||
msgid "For PHP, it is forbidden to write in the folder for uploading avatars"
|
||||
msgstr "Для PHP установлен запрет на запись в папку аватарок."
|
||||
|
|
Loading…
Add table
Reference in a new issue