Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb7c508

Browse files
fix: reset form and quiz color on reset lesson (#1903)
* ./mvnw spotless:apply ``` [INFO] --- spotless-maven-plugin:2.41.1:apply (default-cli) @ webgoat --- [INFO] Writing clean file: /home/ulyssa/labs/WebGoat/WebGoat-bb6e84d/src/main/java/org/owasp/webgoat/lessons/sqlinjection/introduction/SqlInjectionLesson5a.java ``` * On reset lesson: reset form and quizzes colors
1 parent f4c86be commit cb7c508

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/org/owasp/webgoat/lessons/sqlinjection/introduction/SqlInjectionLesson5a.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public class SqlInjectionLesson5a extends AssignmentEndpoint {
4141
+ " '1'</span> always evaluates to true (The string ending literal for '1 is closed by"
4242
+ " the query itself, so you should not inject it). So the injected query basically looks"
4343
+ " like this: <span style=\"font-style: italic\">SELECT * FROM user_data WHERE"
44-
+ " first_name = 'John' and last_name = '' or TRUE</span>, which will always evaluate to"
45-
+ " true, no matter what came before it.";
44+
+ " (first_name = 'John' and last_name = '') or (TRUE)</span>, which will always evaluate"
45+
+ " to true, no matter what came before it.";
4646
private final LessonDataSource dataSource;
4747

4848
public SqlInjectionLesson5a(LessonDataSource dataSource) {

src/main/resources/webgoat/static/js/goatApp/view/LessonContentView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ define(['jquery',
147147
},
148148

149149
markAssignmentComplete: function () {
150-
this.curForm.reset();
151150
$(this.curForm).siblings('.assignment-success').find('i').removeClass('hidden');
152151
this.paginationControlView.updateCollection();
153152
},
@@ -222,6 +221,8 @@ define(['jquery',
222221
},
223222

224223
resetLesson: function () {
224+
this.$el.find(form).trigger("reset");
225+
this.$el.find(".quiz_question").removeClass('correct incorrect');
225226
this.$el.find('.attack-feedback').hide();
226227
this.$el.find('.attack-output').hide();
227228
this.markAssignmentIncomplete();

0 commit comments

Comments
 (0)