<commit_before><?php

/**
 * @package anno
 * This file is part of the Annotum theme for WordPress
 * Built on the Carrington theme framework <http://carringtontheme.com>
 *
 * Copyright 2008-2011 Crowd Favorite, Ltd. All rights reserved. <http://crowdfavorite.com>
 * Released under the GPL license
 * http://www.opensource.org/licenses/gpl-license.php
 *
 * Based on code found in WordPress Importer plugin
 */

if (!defined('WP_LOAD_IMPORTERS'))
	return;

/** Display verbose errors */
if (!defined('ANNO_IMPORT_DEBUG')) {
	define( 'ANNO_IMPORT_DEBUG', false );
}

// Load Importer API
require_once ABSPATH.'wp-admin/includes/import.php';

if ( ! class_exists( 'WP_Importer' ) ) {
	$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
	if ( file_exists( $class_wp_importer ) )<commit_msg>Allow editors and authors to import knol and kipling xml files, prevents them from uploading other types of exported content<commit_after><?php

/**
 * @package anno
 * This file is part of the Annotum theme for WordPress
 * Built on the Carrington theme framework <http://carringtontheme.com>
 *
 * Copyright 2008-2011 Crowd Favorite, Ltd. All rights reserved. <http://crowdfavorite.com>
 * Released under the GPL license
 * http://www.opensource.org/licenses/gpl-license.php
 *
 * Based on code found in WordPress Importer plugin
 */

if (!defined('WP_LOAD_IMPORTERS'))
	return;

/** Display verbose errors */
if (!defined('ANNO_IMPORT_DEBUG')) {
	define( 'ANNO_IMPORT_DEBUG', false );
}

/**
 * DO NOT MOVE THIS FUNCTION OUT OF THIS FILE
 * Moving this function out of this file will allow those who can edit_articles
 * to import more than just KNOL WXRs and Kipling XML
 *
 * Allows editors and authors to import Knol WXRs and Kipling XML
 **/
function anno_allow_import_cap($cap_mappings, $cap) {
	// Maps the import capability to edit_articles
	// Thus anyone who can edit an article, can import knol or dtd
	if ($cap == 'import') {
		$cap_mappings = array('edit_articles');
	}
	return $cap_mappings;
}
add_filter('map_meta_cap', 'anno_allow_import_cap', 10, 2);

// Load Importer API
require_once ABSPATH.'wp-admin/includes/import.php';

if ( ! class_exists( 'WP_Importer' ) ) {
	$class_wp_importer = ABSPATH . 'wp-admin/includes/class-wp-importer.php';
	if ( file_exists( $class_wp_importer ) )
{'fraction_non_alphanumeric': 0.11576673866090713, 'fraction_numerical': 0.008207343412526998, 'mean_word_length': 4.436619718309859, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, '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': '2977718', 'n_tokens_mistral': 774, 'n_tokens_neox': 742, 'n_words': 230}