<commit_before><?php
class Kwf_Validate_NoTags extends Zend_Validate_Abstract
{
    const INVALID_TAGS = 'invalidTags';

    public function __construct()
    {
        $this->_messageTemplates[self::INVALID_TAGS] = trlKwfStatic("Must not include tags");
    }

    public function isValid($value)
    {
        if (strip_tags($value) != $value || stripos($value, 'Content-Type:') !== false) {
            $this->_error(self::INVALID_TAGS);
            return false;
        }
        return true;
    }
}
<commit_msg>Fix problems with validating null and integer values for tags<commit_after><?php
class Kwf_Validate_NoTags extends Zend_Validate_Abstract
{
    const INVALID_TAGS = 'invalidTags';

    public function __construct()
    {
        $this->_messageTemplates[self::INVALID_TAGS] = trlKwfStatic("Must not include tags");
    }

    public function isValid($value)
    {
        if (!$value) return true;
        if (!is_array($value)) {
            $value = array($value);
        }
        foreach ($value as $key => $val) {
            if (strip_tags($val) != $val || stripos($val, 'Content-Type:') !== false) {
                $this->_error(self::INVALID_TAGS);
                return false;
            }
        }
        return true;
    }
}

{'fraction_non_alphanumeric': 0.12698412698412698, 'fraction_numerical': 0.0, 'mean_word_length': 2.4930747922437675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '319270', 'n_tokens_mistral': 379, 'n_tokens_neox': 373, 'n_words': 82}