<commit_before><?php
/**
 * Business Enterprise Employee Repository (B.E.E.R)
 * Developed for <NAME>'s Developer Showdown, using Nooku Framework
 * @version		$Id$
 * @package		Beer
 * @license 	GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.nooku.org
 */

defined('KOOWA') or die('Restricted access');
Koowa::import('admin::com.beer.controllers.abstract');

/**
 * Office Controller
 *
 * @package		Beer
 */
class BeerControllerOffice extends BeerControllerAbstract
{
	/**
	 * Filter input values, modify request
	 *
	 * @params	Arguments
	 * @return 	void
	 */
	public function filterInput($args)
	{
		$alias 			= KRequest::get('post.alias', 'ascii');
		$title 			= KRequest::get('post.title', 'string');
		$description	= KRequest::get('post.description', 'raw' );
		

			// Set query
			$address 	= KRequest::get('post.address1', 'string');
			$address 	= str_replace(" ", "+", $address);
			$city 		= KRequest::get('post.city', 'string');
			$postcode	= KRequest::get('post.postcode', 'string');
			$postcode 	= KRequest::get('post.title', 'string');

			$query = $address.'+'.$city;

			// Desired address
			$geocoding = "http://maps.google.com/maps/geo?q=" . $query . "&output=xml&oe=utf8&sensor=true";

			// Retrieve the URL contents
			$answer = file_get_contents($geocoding);

			// Parse the returned XML file
			$xml = new SimpleXMLElement($answer);

			// Parse the coordinate string
			list($longitude, $latitude, $altitude) = explode(",",$xml->Response->Placemark->Point->coordinates);

			$coordinates = $latitude . ',' . $longitude;

		if(empty($alias)) {
			$alias = KRequest::get('post.title', 'ascii');
		}

		KRequest::set('post.coordinates', $coordinates);
		KRequest::set('post.alias', $alias);
		KRequest::set('post.description', $description);
	}
}<commit_msg>cleanup<commit_after><?php
/**
 * Business Enterprise Employee Repository (B.E.E.R)
 * Developed for <NAME>'s Developer Showdown, using Nooku Framework
 * @version		$Id$
 * @package		Beer
 * @license 	GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.nooku.org
 */

defined('KOOWA') or die('Restricted access');
Koowa::import('admin::com.beer.controllers.abstract');

/**
 * Office Controller
 *
 * @package		Beer
 */
class BeerControllerOffice extends BeerControllerAbstract
{
	/**
	 * Filter input values, modify request
	 *
	 * @params	Arguments
	 * @return 	void
	 */
	public function filterInput($args)
	{
		$alias 			= KRequest::get('post.alias', 'ascii');
		$title 			= KRequest::get('post.title', 'string');
		$description	= KRequest::get('post.description', 'raw' );
		

			// Set query
			$address 	= KRequest::get('post.address1', 'string');
			$address 	= str_replace(" ", "+", $address);
			$city 		= KRequest::get('post.city', 'string');
			$postcode	= KRequest::get('post.postcode', 'string');

			$query = $address.'+'.$city;

			// Desired address
			$geocoding = "http://maps.google.com/maps/geo?q=" . $query . "&output=xml&oe=utf8&sensor=true";

			// Retrieve the URL contents
			$answer = file_get_contents($geocoding);

			// Parse the returned XML file
			$xml = new SimpleXMLElement($answer);

			// Parse the coordinate string
			list($longitude, $latitude, $altitude) = explode(",",$xml->Response->Placemark->Point->coordinates);

			$coordinates = $latitude . ',' . $longitude;

		if(empty($alias)) {
			$alias = KRequest::get('post.title', 'ascii');
		}

		KRequest::set('post.coordinates', $coordinates);
		KRequest::set('post.alias', $alias);
		KRequest::set('post.description', $description);
	}
}
{'fraction_non_alphanumeric': 0.1875520978049458, 'fraction_numerical': 0.0027785495971103086, 'mean_word_length': 4.042016806722689, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6959345', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1215, 'n_words': 233}