<commit_before><?php
/**
 * @version     $Id$
 * @package     Nooku_Components
 * @subpackage  Files
 * @copyright   Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Folder Name Filter Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/ercanozkaya>
 * @package     Nooku_Components
 * @subpackage  Files
 */

class ComFilesFilterFolderName extends KFilterAbstract
{
	protected $_walk = false;

	protected function _validate($context)
	{
		$value = $context->caller->name;

		if (strpos($value, '/') !== false) {
			$context->setError(JText::_('Folder names cannot contain slashes'));
			return false;
		}

		if ($this->_sanitize($value) == '') {
			$context->setError(JText::_('Invalid folder name'));
			return false;<commit_msg>Use KCommandContext::getSubject() instead of $command->caller<commit_after><?php
/**
 * @version     $Id$
 * @package     Nooku_Components
 * @subpackage  Files
 * @copyright   Copyright (C) 2011 - 2012 Timble CVBA and Contributors. (http://www.timble.net).
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.nooku.org
 */

/**
 * Folder Name Filter Class
 *
 * @author      <NAME> <http://nooku.assembla.com/profile/ercanozkaya>
 * @package     Nooku_Components
 * @subpackage  Files
 */

class ComFilesFilterFolderName extends KFilterAbstract
{
	protected $_walk = false;

	protected function _validate($context)
	{
		$value = $context->getSubject()->name;

		if (strpos($value, '/') !== false) {
			$context->setError(JText::_('Folder names cannot contain slashes'));
			return false;
		}

		if ($this->_sanitize($value) == '') {
			$context->setError(JText::_('Invalid folder name'));
			return false;
{'fraction_non_alphanumeric': 0.16158868335146898, 'fraction_numerical': 0.009793253536452665, 'mean_word_length': 3.620603015075377, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '980898', 'n_tokens_mistral': 643, 'n_tokens_neox': 603, 'n_words': 131}