<commit_before><?php
/*
 * PHP-Export scripts of OpenEstate-ImmoTool
 * Copyright (C) 2009-2018 OpenEstate.org
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Website-Export, Darstellung einer Captcha-Grafik.
 *
 * @author <NAME> & <NAME>
 * @copyright 2009-2018, OpenEstate.org
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 */

// Initialisierung
if (!extension_loaded('gd')) {
  if (!headers_sent()) {
    // 500-Fehlercode zurückliefern,
    // wenn das GD-PHP-Modul nicht verfügbar ist
    header('HTTP/1.0 500 Internal Server Error');
  }
  echo 'It seems like GD is not installed!';
  return;
}

require_once(__DIR__ . '/config.php');
require_once(__DIR__ . '/private.php');
require_once(__DIR__ . '/include/functions.php');

define('CAPTCHA_FONT_PATH', immotool_functions::get_path('include/fonts'));
define('CAPTCHA_LENGTH', 5);
//define( 'CAPTCHA_SYMBOLS', 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789');
define('CAPTCHA_SYMBOLS', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789');
define('CAPTCHA_SIZE_X', 125);
define('CAPTCHA_SIZE_Y', 30);
define('CAPTCHA_SIZE_FONT', 25);
define('CAPTCHA_VARIABLE', 'captchaCode');

$setup = new immotool_setup();
immotool_functions::init_config($setup, 'load_config_default');
immotool_functions::init_session();

// zufällige TTF Schriftart ermitteln
$fonts = array();
$files = immotool_functions::list_directory(CAPTCHA_FONT_PATH);
if (is_array($files)) {
  foreach ($files as $file) {<commit_msg>fixed PHP warning in captcha.php<commit_after><?php
/*
 * PHP-Export scripts of OpenEstate-ImmoTool
 * Copyright (C) 2009-2018 OpenEstate.org
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * Website-Export, Darstellung einer Captcha-Grafik.
 *
 * @author <NAME> & <NAME>
 * @copyright 2009-2018, OpenEstate.org
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 */

// Initialisierung
if (!extension_loaded('gd')) {
  if (!headers_sent()) {
    // 500-Fehlercode zurückliefern,
    // wenn das GD-PHP-Modul nicht verfügbar ist
    header('HTTP/1.0 500 Internal Server Error');
  }
  echo 'It seems like GD is not installed!';
  return;
}

ob_start();
require_once(__DIR__ . '/config.php');
require_once(__DIR__ . '/private.php');
require_once(__DIR__ . '/include/functions.php');

define('CAPTCHA_FONT_PATH', immotool_functions::get_path('include/fonts'));
define('CAPTCHA_LENGTH', 5);
//define( 'CAPTCHA_SYMBOLS', 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ0123456789');
define('CAPTCHA_SYMBOLS', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789');
define('CAPTCHA_SIZE_X', 125);
define('CAPTCHA_SIZE_Y', 30);
define('CAPTCHA_SIZE_FONT', 25);
define('CAPTCHA_VARIABLE', 'captchaCode');

$setup = new immotool_setup();
immotool_functions::init_config($setup, 'load_config_default');
immotool_functions::init_session();

// zufällige TTF Schriftart ermitteln
$fonts = array();
$files = immotool_functions::list_directory(CAPTCHA_FONT_PATH);
if (is_array($files)) {
  foreach ($files as $file) {
{'fraction_non_alphanumeric': 0.1259570264262781, 'fraction_numerical': 0.026673252654976536, 'mean_word_length': 5.090225563909774, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5955361', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1344, 'n_words': 363}