Bug #43944
closed$TSFE->tmpl->setup sometimes not completely present in tslib_fe->sendFormmail()
0%
Description
The issue presents itself as follows:
Hook into tslib_fe->sendFormmail()
with $TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sendFormmail-PreProcClass']
.
Sometimes when checking for plugin configuration, $TSFE->tmpl->setup['plugin.']['tx_someplugin']
is not available because something went wrong with the caching (I have no idea what causes this).
We are using wt_spamshield
and a custom captcha extension. Both are checking for their plugin configuration ("enable = 1") and obviously fail because there's only a basic setup present. This generated a massive amount of SPAM mails being sent over one of our standard mailforms.
Because we're already xclassing tslib_fe
and extending sendFormmail()
through our custom captcha extension, the quick fix was to write the following at the beginning of the function (~Line 2543):
function sendFormmail() { global $TSFE; $formmail = t3lib_div::makeInstance('t3lib_formmail'); $EMAIL_VARS = t3lib_div::_POST(); ## if no plugin config is present, something has gone wrong if (empty($TSFE->tmpl->setup['pugin.'])) { $TSFE->forceTemplateParsing = 1; $TSFE->getConfigArray(); }
Of course, if no plugins were installed, then
$TSFE->getConfigArray();
would be called in vain - but the downside of not having any plugin configuration is far worse than some additional time spent parsing the setup again (even if it came from cache).This fix is easy to implement, although it doesn't fix the issue of why the correct setup wasn't available in the first place.