<commit_before><?php

use wcf\system\WCF;

/**
 * Removes the files belonging to the old MailForm in order to make this completely non-functional.
 * 
 * @author	<NAME>
 * @copyright	2001-2020 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core
 */

@unlink(WCF_DIR . 'lib/form/MailForm.class.php');
@unlink(WCF_DIR . 'templates/mail.tpl');

// delete file log entry
$sql = "DELETE FROM	wcf".WCF_N."_package_installation_file_log
	WHERE		packageID = ?
			AND filename = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([
	$this->installation->getPackageID(),
	'lib/form/MailForm.class.php'
]);
$sql = "DELETE FROM	wcf".WCF_N."_template
	WHERE		packageID = ?
			AND templateName = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([
	$this->installation->getPackageID(),
	'mail'
]);<commit_msg>Do not ignore errors in invalidateMailForm update script<commit_after><?php

use wcf\system\WCF;

/**
 * Removes the files belonging to the old MailForm in order to make this completely non-functional.
 * 
 * @author	<NAME>, <NAME>
 * @copyright	2001-2020 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core
 */

if (file_exists(WCF_DIR . 'lib/form/MailForm.class.php')) {
	unlink(WCF_DIR . 'lib/form/MailForm.class.php');
}

// At this point the MailForm.class.php must be absent. Either the unlink() succeeded or
// the file already was gone.
$sql = "DELETE FROM	wcf".WCF_N."_package_installation_file_log
	WHERE		packageID = ?
			AND filename = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([
	$this->installation->getPackageID(),
	'lib/form/MailForm.class.php'
]);

if (file_exists(WCF_DIR . 'templates/mail.tpl')) {
	unlink(WCF_DIR . 'templates/mail.tpl');
}

$sql = "DELETE FROM	wcf".WCF_N."_template
	WHERE		packageID = ?
			AND templateName = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([
	$this->installation->getPackageID(),
	'mail'
]);
{'fraction_non_alphanumeric': 0.15772128060263654, 'fraction_numerical': 0.007532956685499058, 'mean_word_length': 4.743243243243243, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 24, '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': '6746358', 'n_tokens_mistral': 766, 'n_tokens_neox': 728, 'n_words': 162}