[TYPO3-ttnews] Re: Extra characters in URL ?L=/../..

Eddie Hofmann edi at webeddie.ch
Thu May 30 14:58:05 CEST 2013


Yes, I use config.linkVars = L(int) as well. But chars in _-Parameter did return after some time.
So, as already using jQuery I call the following function after document-ready. Replace by getelements.byid if noct using jQuery.

function cleanHrefs() {
	var z=0;
	var origHref, zwHref, zwLparm='';
	$('a').each(function() {
		zwHref=$(this).attr('href');
		if (!zwHref) { return true; } /* If weird Href get next (continue) */
		z=zwHref.indexOf('L=');
		if (z>2) {
			zwLparm=zwHref.substr(z+2);
			if (!is_int(zwLparm)) {
				zwHref=zwHref.substr(0,z-1);
				$(this).attr('href',zwHref);
			}
		}
	});
}
function is_int(value){
   for (i = 0 ; i < value.length ; i++) {
      if ((value.charAt(i) < '0') || (value.charAt(i) > '9')) {return false;}
    }
   return true;
}


More information about the TYPO3-project-tt-news mailing list