<commit_before><?php

class Form {
    /**
     * This class will mainly be used
     * to build forms with static methods
     */

    /**
     * @var String
     */
    private static $standard_method = 'post';

    /**
     * @param $method
     * @param $action
     */
    public static function open($method, $action, $css) {
        /**
         * Instantiates a new form.
         * parameters will fill in the
         * required
         */
        echo "<form method='".$method." class=".$css."' action='".$action."' role='form'>";
    }

    public static function close() {
        /**
         * Closes the form
         */
        echo '</form>';
    }

    /**
     * @param $name
     */
    public static function submit($name, $css) {
        /**
         * Generates a submit button
         */
        echo '<input type="submit" class="'.$css.'" value="submit" name="'.$name.'"/>';
    }

    /**
     * @param $value
     * @param $name
     */
    public static function hidden($name, $value) {
        /**
         * Generates hidden input field
         */
        echo '<input type="hidden" value="'.$value.'" name="'.$name.'"/>';
    }

    /**
     * @param $name
     * @param $placeholder
     */
    public static function text($name, $placeholder, $css) {
        /**
         * Generates text input field
         */
        echo '<input type="text" name="'.$name.'" class="'.$css.'" placeholder="'.$placeholder.'"/>';
    }
}<commit_msg>Faked requests and forms functie fix<commit_after><?php

class Form {
    /**
     * This class will mainly be used
     * to build forms with static methods
     */

    /**
     * @var String
     */
    private static $standard_method = 'post';

    /**
     * @param $method
     * @param $action
     */
    public static function open($method, $action, $css) {
        /**
         * Instantiates a new form.
         * parameters will fill in the
         * required
         */
        echo "<form method='".$method." class=".$css."' action='".$action."' role='form'>";
    }

    public static function close() {
        /**
         * Closes the form
         */
        echo '</form>';
    }

    /**
     * @param $name
     */
    public static function submit($name, $css) {
        /**
         * Generates a submit button
         */
        echo '<input type="submit" class="'.$css.'" value="submit" name="'.$name.'"/>';
    }

    /**
     * @param $value
     * @param $name
     */
    public static function hidden($name, $value) {
        /**
         * Generates hidden input field
         */
        echo '<input type="hidden" value="'.$value.'" name="'.$name.'"/>';
    }

    /**
     * @param $name
     * @param $placeholder
     */
    public static function text($name, $placeholder, $css) {
        /**
         * Generates text input field
         */
        echo '<input type="text" name="'.$name.'" class="'.$css.'" placeholder="'.$placeholder.'"/>';
    }
	
	public static function request_is_same_domain() {
		/**
	     * Use with request_is_post() to block posting from off-site forms
	     */
		if(!isset($_SERVER['HTTP_REFERER'])) {
			/**
			 * No refererer sent, so can't be same domain
			 */
			return false;
		} else {
			$referer_host = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
			$server_host = $_SERVER['HTTP_HOST'];
			
			/**
			 * Uncomment for debugging
			 */
//			 echo 'Request from: ' . $referer_host . "<br />";
//			 echo 'Request to: ' . $server_host . "<br />";
			
			return ($referer_host == $server_host) ? true : false;
		}
	}
}
{'fraction_non_alphanumeric': 0.17179630665920537, 'fraction_numerical': 0.0, 'mean_word_length': 1.7995301487862176, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '6152588', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1040, 'n_words': 275}