15
ghia,
True it should actually check for the particular file, not just the directory. I just took the 'easy' (aka lazy) way for the patch.
Although the section of code where this is placed isn't actually looking for the Quote:
category_linksubmit_notify.tpl
file in your code snippet above. The way it should 'ultimately' be patched is:
if (!is_readable($templdir.$thistemplate)) {
$templdir = XOOPS_ROOT_PATH . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . $mydirname . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR . 'english' . DIRECTORY_SEPARATOR . 'mail_template' . DIRECTORY_SEPARATOR;
}
if (!is_readable($templdir.$thistemplate)) {
exit("System Error: '{$thistemplate}' email template could not be found.");
}
As a side note I would rather use 'is_readable' instead of 'file_exists' since the file may exist but security settings could prevent the file from being read by the script so the script would fail without any error message...