<commit_before><?php
namespace Axllent\EnquiryPage;

use Axllent\EnquiryPage\Forms\CaptchaField;
use PageController;
use SilverStripe\Control\Director;
use SilverStripe\Control\Email\Email;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Config\Config;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\CheckboxSetField;
use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\EmailField;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\Form;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\HTMLReadonlyField;
use SilverStripe\Forms\LiteralField;
use SilverStripe\Forms\OptionSetField;
use SilverStripe\Forms\RequiredFields;
use SilverStripe\Forms\TextAreaField;
use SilverStripe\Forms\TextField;
use SilverStripe\View\Parsers\ShortcodeParser;
use SilverStripe\View\Parsers\URLSegmentFilter;
use SilverStripe\View\Requirements;

class EnquiryPageController extends PageController
{
    /**
     * Allowed actions
     *
     * @var    array
     * @config
     */
    private static $allowed_actions = [
        'EnquiryForm',
        'captcha',
    ];

    /**
     * Index
     *
     * @param HTTPRequest $request HTTP request
     *
     * @return HTTPResponse
     */
    public function index($request)
    {
        return $this->renderWith(['EnquiryPage', 'Page']);
    }

    /**
     * Enquiry form
     *
     * @return Form
     */
    public function enquiryForm()
    {
        if (!Email::is_valid_address($this->EmailTo)
            || !Email::is_valid_address($this->EmailFrom)<commit_msg>Fix `Email::is_valid_address()` error when value is null<commit_after><?php
namespace Axllent\EnquiryPage;

use Axllent\EnquiryPage\Forms\CaptchaField;
use PageController;
use SilverStripe\Control\Director;
use SilverStripe\Control\Email\Email;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Config\Config;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\CheckboxSetField;
use SilverStripe\Forms\DropdownField;
use SilverStripe\Forms\EmailField;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\Form;
use SilverStripe\Forms\FormAction;
use SilverStripe\Forms\HTMLReadonlyField;
use SilverStripe\Forms\LiteralField;
use SilverStripe\Forms\OptionSetField;
use SilverStripe\Forms\RequiredFields;
use SilverStripe\Forms\TextAreaField;
use SilverStripe\Forms\TextField;
use SilverStripe\View\Parsers\ShortcodeParser;
use SilverStripe\View\Parsers\URLSegmentFilter;
use SilverStripe\View\Requirements;

class EnquiryPageController extends PageController
{
    /**
     * Allowed actions
     *
     * @var    array
     * @config
     */
    private static $allowed_actions = [
        'EnquiryForm',
        'captcha',
    ];

    /**
     * Index
     *
     * @param HTTPRequest $request HTTP request
     *
     * @return HTTPResponse
     */
    public function index($request)
    {
        return $this->renderWith(['EnquiryPage', 'Page']);
    }

    /**
     * Enquiry form
     *
     * @return Form
     */
    public function enquiryForm()
    {
        if (!$this->EmailTo || !$this->EmailFrom
            || !Email::is_valid_address($this->EmailTo)
            || !Email::is_valid_address($this->EmailFrom)
{'fraction_non_alphanumeric': 0.10615048392132376, 'fraction_numerical': 0.0, 'mean_word_length': 3.6367583212735166, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1855778', 'n_tokens_mistral': 1021, 'n_tokens_neox': 1017, 'n_words': 177}