/** * Check input, strip slashes etc. set alert, if input is not ok. * * @return boolean Input ok, true/false */ function checkInput() { global $lng; $_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()]); if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == "") { $this->setAlert($lng->txt("msg_input_is_required")); return false; } include_once "./Services/Captcha/classes/class.ilSecurImage.php"; $si = new ilSecurImage(); if (!$si->check($_POST[$this->getPostVar()])) { $this->setAlert($lng->txt("cptch_wrong_input")); return false; } return true; }
/** * Check input, strip slashes etc. set alert, if input is not ok. * @return boolean Input ok, true/false */ public function checkInput() { global $lng; $_POST[$this->getPostVar()] = ilUtil::stripSlashes($_POST[$this->getPostVar()]); if ($this->getRequired() && trim($_POST[$this->getPostVar()]) == '') { if ($lng instanceof ilLanguage) { $this->setAlert($lng->txt('msg_input_is_required')); } return false; } include_once './Services/Captcha/classes/class.ilSecurImage.php'; $si = new ilSecurImage(); if (!$si->check($_POST[$this->getPostVar()])) { if ($lng instanceof ilLanguage) { $this->setAlert($lng->txt('cptch_wrong_input')); } return false; } return true; }