Created
February 28, 2020 02:23
-
-
Save fidlerryan/ae01e335d7b8dce07ea2c262f1c40b5b to your computer and use it in GitHub Desktop.
Joomla's Email Protection Script in an AJAX Response
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
azXhr.onload = function(){ | |
if( azXhr.status === 200 ){ | |
var azDirectory = document.getElementById( 'modazdirectory' ); | |
// replace with the DOM with the results of the AJAX call | |
azDirectory.innerHTML = azXhr.responseText; | |
// look for embedded scripts within the HTML | |
var azEmailCloak = azDirectory.querySelectorAll( 'script' ); | |
for( var i = 0; i < azEmailCloak.length; i++ ){ | |
// execute the scripts using the safer Function method as opposed to eval | |
var azParsed = new Function( azEmailCloak[i].innerHTML ); | |
return azParsed(); | |
} | |
// re-bind event handlers | |
} else { | |
// request failed | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment