<commit_before>Frontend.Router = Class.extend({
	webroot: '',
	controller: '',
	action: '',
	named: {},
	currentUrl: '',
	urlDefaults: {
		controller: null,
		action: null,
		pass: [],
		query: {},
		prefix: '',
		plugin: null
	},
	/**
	 * Class constructor
	 *
	 * @param	Object	the appData object
	 * @return 	void 
	 */
	init: function(appData) {
		this.webroot = appData.webroot;
		this.controller = appData.controller;
		this.action = appData.action;
		this.named = appData.named;
		this.currentUrl = appData.url;
	},
	/**
	 * Constructs an url based on the given parameters.
	 * 
	 * The method also accepts an object containing at least the controller 
	 * and action keys (see this.urlDefaults). Otherwise it takes
	 * the function arguments.
	 * 
	 * @param string	controller 	The controller name in lower case
	 * @param string	action 		The controller action
	 * @param Array		pass		An array containing the pass params (/arg1/arg2/)
	 * @param Object 	query		An object containing the named params, indexed by param name
	 * @return string				The generated URL
	 */
	url: function(controller, action, pass, query) {
		if(typeof controller == 'object') {
			var params = jQuery.extend({}, this.urlDefaults, controller);
			var controller = params.controller;
			var action = params.action;
			var pass = params.pass;
			var prefix = params.prefix;
			var query = params.query;
			var plugin = params.plugin;
		}
		
		if(plugin) {
			plugin = plugin + '/';
		} else {
			plugin = '';
		}
		
		var url = this.webroot + prefix + plugin + controller + '/' + action + '/';

		if(pass instanceof Array) {
			for(var i in pass) {
				url += pass[ i ] + '/';
			}
		}
		
		if(typeof get == 'object') {
			url += '?' + http_build_query(query);
		}
		return url;
	},
	/**
	 * Returns the complete, current URL of the site.
	 *
	 * @return void 
	 */
	getCurrentUrl: function() {
		return this.webroot + '/' + this.url;
	}
});<commit_msg>fix router naming issue, preventing to pass GET query args to an url<commit_after>Frontend.Router = Class.extend({
	webroot: '',
	controller: '',
	action: '',
	named: {},
	currentUrl: '',
	urlDefaults: {
		controller: null,
		action: null,
		pass: [],
		query: {},
		prefix: '',
		plugin: null
	},
	/**
	 * Class constructor
	 *
	 * @param	Object	the appData object
	 * @return 	void 
	 */
	init: function(appData) {
		this.webroot = appData.webroot;
		this.controller = appData.controller;
		this.action = appData.action;
		this.named = appData.named;
		this.currentUrl = appData.url;
	},
	/**
	 * Constructs an url based on the given parameters.
	 * 
	 * The method also accepts an object containing at least the controller 
	 * and action keys (see this.urlDefaults). Otherwise it takes
	 * the function arguments.
	 * 
	 * @param string	controller 	The controller name in lower case
	 * @param string	action 		The controller action
	 * @param Array		pass		An array containing the pass params (/arg1/arg2/)
	 * @param Object 	query		An object containing the named params, indexed by param name
	 * @return string				The generated URL
	 */
	url: function(controller, action, pass, query) {
		if(typeof controller == 'object') {
			var params = jQuery.extend({}, this.urlDefaults, controller);
			var controller = params.controller;
			var action = params.action;
			var pass = params.pass;
			var prefix = params.prefix;
			var query = params.query;
			var plugin = params.plugin;
		}
		
		if(plugin) {
			plugin = plugin + '/';
		} else {
			plugin = '';
		}
		
		var url = this.webroot + prefix + plugin + controller + '/' + action + '/';

		if(pass instanceof Array) {
			for(var i in pass) {
				url += pass[ i ] + '/';
			}
		}
		
		if(typeof query == 'object') {
			url += '?' + http_build_query(query);
		}
		return url;
	},
	/**
	 * Returns the complete, current URL of the site.
	 *
	 * @return void 
	 */
	getCurrentUrl: function() {
		return this.webroot + '/' + this.url;
	}
});
{'fraction_non_alphanumeric': 0.1311433664374841, 'fraction_numerical': 0.0010185892538833714, 'mean_word_length': 2.963673057517659, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7524640', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1209, 'n_words': 384}