www/js/csrfprotector.js
/** 
	 * Wrapper to XHR open method
	 * Add a property method to XMLHttpRequest class
	 * @param: all parameters to XHR open method
	 * @return: object returned by default, XHR open method
	 */
Wrapper to XHR open method
Add a property method to XMLHttpRequest class
@param: all parameters to XHR open method
@return: object returned by default, XHR open method
Wrapper to XHR open method Add a property method to XMLHttpRequest class @param : all parameters to XHR open method @return : object returned by default XHR open method
function new_open(method, url, async, username, password) {
		this.method = method;
		var isAbsolute = (url.indexOf("./") === -1);
		if (!isAbsolute) {
			var base = location.protocol +'//' +location.host 
							+ location.pathname;
			url = CSRFP._getAbsolutePath(base, url);
		}
		if (method.toLowerCase() === 'get' 
			&& !CSRFP._isValidGetRequest(url)) {
			if (url.indexOf('?') === -1) {
				url += "?" +CSRFP.CSRFP_TOKEN +"=" +CSRFP._getAuthKey();
			} else {
				url += "&" +CSRFP.CSRFP_TOKEN +"=" +CSRFP._getAuthKey();
			}
		}
		return this.old_open(method, url, async, username, password);
	}
function new_open ( method , url , async , username , password ) { this . method = method ; var isAbsolute = ( url . indexOf ( "./" ) === - 1 ) ; if ( ! isAbsolute ) { var base = location . protocol + '//' + location . host + location . pathname ; url = CSRFP . _getAbsolutePath ( base , url ) ; } if ( method . toLowerCase ( ) === 'get' && ! CSRFP . _isValidGetRequest ( url ) ) { if ( url . indexOf ( '?' ) === - 1 ) { url += "?" + CSRFP . CSRFP_TOKEN + "=" + CSRFP . _getAuthKey ( ) ; } else { url += "&" + CSRFP . CSRFP_TOKEN + "=" + CSRFP . _getAuthKey ( ) ; } } return this . old_open ( method , url , async , username , password ) ; }
Wrapper to XHR open method
 Add a property method to XMLHttpRequest class
 @param: all parameters to XHR open method
 @return: object returned by default, XHR open method
Wrapper to XHR open method Add a property method to XMLHttpRequest class @param : all parameters to XHR open method @return : object returned by default XHR open method
//modify the url