From 8050bd52c464ac1c17694960f4acc2b34a6868c3 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 10 Sep 2016 16:14:10 +0200 Subject: [PATCH] Navigation and links are not the same after reboot #194 --- .../owasp/webgoat/lessons/AbstractLesson.java | 81 ++++++++++--------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/webgoat-container/src/main/java/org/owasp/webgoat/lessons/AbstractLesson.java b/webgoat-container/src/main/java/org/owasp/webgoat/lessons/AbstractLesson.java index 5598af3b1..211d52f9e 100644 --- a/webgoat-container/src/main/java/org/owasp/webgoat/lessons/AbstractLesson.java +++ b/webgoat-container/src/main/java/org/owasp/webgoat/lessons/AbstractLesson.java @@ -35,35 +35,37 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import static java.lang.Math.abs; + /** - ************************************************************************************************* - * - * + * ************************************************************************************************ + *

+ *

* This file is part of WebGoat, an Open Web Application Security Project utility. For details, * please see http://www.owasp.org/ - * + *

* Copyright (c) 2002 - 20014 Bruce Mayhew - * + *

* This program is free software; you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. - * + *

* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + *

* You should have received a copy of the GNU General Public License along with this program; if * not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. - * + *

* Getting Source ============== - * + *

* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software * projects. * * @author Bruce Mayhew WebGoat - * @since October 28, 2003 * @version $Id: $Id + * @since October 28, 2003 */ public abstract class AbstractLesson extends Screen implements Comparable { @@ -74,7 +76,9 @@ public abstract class AbstractLesson extends Screen implements ComparableCHALLENGE_ROLE="challenge" */ + /** + * Constant CHALLENGE_ROLE="challenge" + */ public final static String CHALLENGE_ROLE = "challenge"; /** @@ -120,7 +124,9 @@ public abstract class AbstractLesson extends Screen implements Comparable * Description of the Method */ public int compareTo(Object obj) { @@ -194,7 +200,7 @@ public abstract class AbstractLesson extends Screen implements Comparable * Description of the Method */ public boolean equals(Object obj) { @@ -368,6 +374,7 @@ public abstract class AbstractLesson extends Screen implements ComparablegetHintsPublic.

* @@ -383,9 +390,9 @@ public abstract class AbstractLesson extends Screen implements ComparableReturns the default "path" portion of a lesson's URL.

- * - * + *

+ *

* Legacy webgoat lesson links are of the form * "attack?Screen=Xmenu=Ystage=Z". This method returns the path portion of * the url, i.e., "attack" in the string above. - * + *

* Newer, Spring-Controller-based classes will override this method to * return "*.do"-styled paths. * @@ -630,7 +637,7 @@ public abstract class AbstractLesson extends Screen implements Comparable * Rendering the link in the browser may result in Javascript sending * additional requests to perform necessary actions or to obtain data * relevant to the lesson or the element of the lesson selected by the @@ -645,13 +652,13 @@ public abstract class AbstractLesson extends Screen implements Comparable * Unlike getLink() this method does not require rendering the output of * the request to the link in order to execute the servlet's method with * conventional HTTP query parameters. @@ -662,8 +669,8 @@ public abstract class AbstractLesson extends Screen implements Comparable