<commit_before><?php
namespace OpenCFP\Form;

use OpenCFP\Model\Speaker;
/**
 * Class representing the form that speakers fill out when they want
 * to submit a talk
 */
class TalkForm extends Form
{
    protected $_fieldList = array(
        'title',
        'description',
        'type',
        'level',
        'category',
        'desired',
        'slides',
        'other',
        'sponsor',
        'user_id'
    );

    /**
     * Santize all our fields that were submitted
     *
     * @return array
     */
    public function sanitize()
    {
        parent::sanitize();

        foreach($this->_cleanData as $key => $value) {
            $this->_cleanData[$key] = strip_tags($value);
        }
    }

    /**
     * Validate everything
     *
     * @return boolean
     */
    public function validateAll($action = 'create')
    {
        return (
            $this->validateTitle() &&
            $this->validateDescription() &&
            $this->validateType() &&
            $this->validateLevel() &&
            $this->validateCategory() &&
            $this->validateDesired() &&
            $this->validateSlides() &&
            $this->validateOther() &&
            $this->validateSponsor()
        );
    }

    /**
     * Method that validates title data
     *
     * @return boolean
     */
    public function validateTitle()
    {
        if (empty($this->_taintedData['title'])) {
            $this->_addErrorMessage("Please fill in the title");
            return false;
        }

        $title = $this->_cleanData['title'];

        if ($title !== $this->_taintedData['title']) {
            $this->_addErrorMessage("You had invalid characters in your talk title");
            return false;
        }

        if (strlen($title) > 100) {
            $this->_addErrorMessage("Your talk title has to be 100 characters or less");<commit_msg>Removing validation for talk type.<commit_after><?php
namespace OpenCFP\Form;

use OpenCFP\Model\Speaker;
/**
 * Class representing the form that speakers fill out when they want
 * to submit a talk
 */
class TalkForm extends Form
{
    protected $_fieldList = array(
        'title',
        'description',
        'type',
        'level',
        'category',
        'desired',
        'slides',
        'other',
        'sponsor',
        'user_id'
    );

    /**
     * Santize all our fields that were submitted
     *
     * @return array
     */
    public function sanitize()
    {
        parent::sanitize();

        foreach($this->_cleanData as $key => $value) {
            $this->_cleanData[$key] = strip_tags($value);
        }
    }

    /**
     * Validate everything
     *
     * @return boolean
     */
    public function validateAll($action = 'create')
    {
        return (
            $this->validateTitle() &&
            $this->validateDescription() &&
            $this->validateLevel() &&
            $this->validateCategory() &&
            $this->validateDesired() &&
            $this->validateSlides() &&
            $this->validateOther() &&
            $this->validateSponsor()
        );
    }

    /**
     * Method that validates title data
     *
     * @return boolean
     */
    public function validateTitle()
    {
        if (empty($this->_taintedData['title'])) {
            $this->_addErrorMessage("Please fill in the title");
            return false;
        }

        $title = $this->_cleanData['title'];

        if ($title !== $this->_taintedData['title']) {
            $this->_addErrorMessage("You had invalid characters in your talk title");
            return false;
        }

        if (strlen($title) > 100) {
            $this->_addErrorMessage("Your talk title has to be 100 characters or less");
{'fraction_non_alphanumeric': 0.1354389721627409, 'fraction_numerical': 0.0032119914346895075, 'mean_word_length': 1.8118886380737396, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1987230', 'n_tokens_mistral': 1019, 'n_tokens_neox': 1002, 'n_words': 244}