return true;
}
+// ttValidTemplateText is used to check template-based user input.
+// When templates are used, required input parts must be filled by user.
+// We identify these parts by 3 "stop sign" emojis (aka "octagonal sign" U+1F6D1).
+function ttValidTemplateText($val)
+{
+ $valid = strpos($val, '🛑🛑🛑') === false; // no 3 "stop sign" emojis in a row.
+ return $valid;
+}
+
// ttValidEmail is used to check user input to validate an email string.
function ttValidEmail($val, $emptyValid = false)
{
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.61.4900 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.62.4901 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
$err->add($i18n->get('error.field'), $i18n->get('label.duration'));
}
if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
- if ($user->isPluginEnabled('tp') && strpos($cl_note, '%req%') !== false) {
- // A %req% element is found in note. They have to be replaced by user.
+ if ($user->isPluginEnabled('tp') && !ttValidTemplateText($cl_note)) {
$err->add($i18n->get('error.field'), $i18n->get('label.note'));
}
if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired'));
}
if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date'));
if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
- if ($user->isPluginEnabled('tp') && strpos($cl_note, '%req%') !== false) {
- // A %req% element is found in note. They have to be replaced by user.
+ if ($user->isPluginEnabled('tp') && !ttValidTemplateText($cl_note)) {
$err->add($i18n->get('error.field'), $i18n->get('label.note'));
}
if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired'));
$err->add($i18n->get('error.field'), $i18n->get('label.duration'));
}
if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
- if ($user->isPluginEnabled('tp') && strpos($cl_note, '%req%') !== false) {
- // A %req% element is found in note. They have to be replaced by user.
+ if ($user->isPluginEnabled('tp') && !ttValidTemplateText($cl_note)) {
$err->add($i18n->get('error.field'), $i18n->get('label.note'));
}
if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired'));
}
if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date'));
if (!ttValidString($cl_note, true)) $err->add($i18n->get('error.field'), $i18n->get('label.note'));
- if ($user->isPluginEnabled('tp') && strpos($cl_note, '%req%') !== false) {
- // A %req% element is found in note. They have to be replaced by user.
+ if ($user->isPluginEnabled('tp') && !ttValidTemplateText($cl_note)) {
$err->add($i18n->get('error.field'), $i18n->get('label.note'));
}
if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired'));