2nd crack at ajaxifying links and forms (made harder since some lessons produce a 2nd form and links based on earlier input

This commit is contained in:
Rick Lawson
2014-09-25 21:25:22 -04:00
parent 019a148c9d
commit b5c40760a6
3 changed files with 188 additions and 187 deletions

View File

@ -35,8 +35,8 @@ import org.owasp.webgoat.lessons.AbstractLesson;
*
* Getting Source ==============
*
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository
* for free software projects.
* Source for this application is maintained at
* https://github.com/WebGoat/WebGoat, a repository for free software projects.
*
* For details, please see http://webgoat.github.io
*
@ -202,12 +202,11 @@ public abstract class Screen {
}
// TODO we could hook all forms here with javascript call to ajax forms plugin
// hook all the links
public String getContent() {
String makeFormsAjax = "<script> $(document).ready(function() { makeFormsAjax(); });</script>";
// handle this on the page with js
makeFormsAjax = "";
return (content == null) ? "" : content.toString() + makeFormsAjax;
String makeAllAjax = "<script>goat.utils.makeFormsAjax();goat.utils.ajaxifyAttackHref();</script>";
// need to do this here as some of the lessons render forms after submission of an ajax form
return (content == null) ? "" : content.toString() + makeAllAjax;
}
/**