<commit_before><?php
namespace wcf\system\bulk\processing\user;
use wcf\data\user\UserList;
use wcf\data\DatabaseObjectList;
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
use wcf\util\StringUtil;

/**
 * Bulk processing action implementation for sending mails to users.
 * 
 * @author	<NAME>
 * @copyright	2001-2017 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\System\Bulk\Processing\User
 * @since	3.0
 */
class SendMailUserBulkProcessingAction extends AbstractUserBulkProcessingAction {
	/**
	 * is 1 if HTML for the email is enabled
	 * @var	integer
	 */
	public $enableHTML = 0;
	
	/**
	 * sender
	 * @var	string
	 */
	public $from = '';
	
	/**
	 * identifier for the mail worker
	 * @var	string
	 */
	public $mailID = '';
	
	/**
	 * email subject
	 * @var	string
	 */
	public $subject = '';
	
	/**
	 * email text
	 * @var	string
	 */
	public $text = '';
	
	/**
	 * @inheritDoc
	 */
	public function executeAction(DatabaseObjectList $objectList) {
		if (!($objectList instanceof UserList)) {
			throw new \InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
		}
		
		if (count($objectList)) {
			// save config in session
			$userMailData = WCF::getSession()->getVar('userMailData');
			if ($userMailData === null) $userMailData = [];
			$this->mailID = count($userMailData);
			$userMailData[$this->mailID] = [
				'action' => '',
				'enableHTML' => $this->enableHTML,
				'from' => $this->from,
				'groupIDs' => '',
				'subject' => $this->subject,
				'text' => $this->text,
				'userIDs' => $objectList->getObjectIDs()
			];
			WCF::getSession()->register('userMailData', $userMailData);
		}
	}
	
	/**
	 * @inheritDoc
	 */
	public function getHTML() {
		if (!count($_POST)) {<commit_msg>fix SendMailUserBulkProcessing<commit_after><?php
namespace wcf\system\bulk\processing\user;
use wcf\data\user\UserList;
use wcf\data\DatabaseObjectList;
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
use wcf\util\StringUtil;

/**
 * Bulk processing action implementation for sending mails to users.
 * 
 * @author	<NAME>
 * @copyright	2001-2017 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\System\Bulk\Processing\User
 * @since	3.0
 */
class SendMailUserBulkProcessingAction extends AbstractUserBulkProcessingAction {
	/**
	 * is 1 if HTML for the email is enabled
	 * @var	integer
	 */
	public $enableHTML = 0;
	
	/**
	 * sender
	 * @var	string
	 */
	public $from = '';
	
	/**
	 * identifier for the mail worker
	 * @var	string
	 */
	public $mailID = '';
	
	/**
	 * email subject
	 * @var	string
	 */
	public $subject = '';
	
	/**
	 * email text
	 * @var	string
	 */
	public $text = '';
	
	/**
	 * @inheritDoc
	 */
	public function executeAction(DatabaseObjectList $objectList) {
		if (!($objectList instanceof UserList)) {
			throw new \InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given.");
		}
		
		if (count($objectList)) {
			// save config in session
			$userMailData = WCF::getSession()->getVar('userMailData');
			if ($userMailData === null) $userMailData = [];
			$this->mailID = count($userMailData) + 1;
			$userMailData[$this->mailID] = [
				'action' => '',
				'enableHTML' => $this->enableHTML,
				'from' => $this->from,
				'groupIDs' => '',
				'subject' => $this->subject,
				'text' => $this->text,
				'userIDs' => $objectList->getObjectIDs()
			];
			WCF::getSession()->register('userMailData', $userMailData);
		}
	}
	
	/**
	 * @inheritDoc
	 */
	public function getHTML() {
		if (!count($_POST)) {
{'fraction_non_alphanumeric': 0.16302343955754542, 'fraction_numerical': 0.006584145377929945, 'mean_word_length': 3.5649038461538463, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 39, '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': '5017427', 'n_tokens_mistral': 1399, 'n_tokens_neox': 1217, 'n_words': 282}