CI_Trackback::receive PHP Method

receive() public method

This function simply validates the incoming TB data. It returns FALSE on failure and TRUE on success. If the data is valid it is set to the $this->data array so that it can be inserted into a database.
public receive ( ) : boolean
return boolean
    public function receive()
    {
        foreach (array('url', 'title', 'blog_name', 'excerpt') as $val) {
            if (empty($_POST[$val])) {
                $this->set_error('The following required POST variable is missing: ' . $val);
                return FALSE;
            }
            $this->data['charset'] = isset($_POST['charset']) ? strtoupper(trim($_POST['charset'])) : 'auto';
            if ($val !== 'url' && MB_ENABLED === TRUE) {
                if (MB_ENABLED === TRUE) {
                    $_POST[$val] = mb_convert_encoding($_POST[$val], $this->charset, $this->data['charset']);
                } elseif (ICONV_ENABLED === TRUE) {
                    $_POST[$val] = @iconv($this->data['charset'], $this->charset . '//IGNORE', $_POST[$val]);
                }
            }
            $_POST[$val] = $val !== 'url' ? $this->convert_xml(strip_tags($_POST[$val])) : strip_tags($_POST[$val]);
            if ($val === 'excerpt') {
                $_POST['excerpt'] = $this->limit_characters($_POST['excerpt']);
            }
            $this->data[$val] = $_POST[$val];
        }
        return TRUE;
    }