<commit_before><?

defined('C5_EXECUTE') or die("Access Denied.");
$pk = PermissionKey::getByHandle('empty_trash');
if (!$pk->validate()) {
	die(t("Access Denied."));
}

$trash = Page::getByPath(TRASH_PAGE_PATH);
$i = 0;
if (is_object($trash) && !$trash->isError()) {
	Loader::model('page_list');
	$pl = new PageList();
	$pl->filterByParentID($trash->getCollectionID());
	$pl->includeInactivePages();
	$pages = $pl->get();	
	foreach($pages as $pc) {
		$cp = new Permissions($pc);
		if ($cp->canDeletePage()) {
			$i++;
			$pc->delete();			
		}
	}
}

if ($i == 1) {<commit_msg>remove unapproved pages from trash<commit_after><?

defined('C5_EXECUTE') or die("Access Denied.");
$pk = PermissionKey::getByHandle('empty_trash');
if (!$pk->validate()) {
	die(t("Access Denied."));
}

$trash = Page::getByPath(TRASH_PAGE_PATH);
$i = 0;
if (is_object($trash) && !$trash->isError()) {
	Loader::model('page_list');
	$pl = new PageList();
	$pl->filterByParentID($trash->getCollectionID());
	$pl->includeInactivePages();
	$pl->displayUnapprovedPages();
	$pages = $pl->get();	
	foreach($pages as $pc) {
		$cp = new Permissions($pc);
		if ($cp->canDeletePage()) {
			$i++;
			$pc->delete();			
		}
	}
}

if ($i == 1) {
{'fraction_non_alphanumeric': 0.23900414937759337, 'fraction_numerical': 0.004979253112033195, 'mean_word_length': 5.28125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '4148693', 'n_tokens_mistral': 494, 'n_tokens_neox': 471, 'n_words': 83}