Skip to content

Commit

Permalink
Merge pull request #38 from pixee/feature/strip-all-alternative
Browse files Browse the repository at this point in the history
Add another newline stripping API
  • Loading branch information
nahsra authored Dec 12, 2024
2 parents 3c078f0 + a2215e1 commit 188d1b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/badges/jacoco.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
git push
fi
- name: "Upload JaCoCo coverage report"
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: jacoco-report
path: build/reports/jacoco/test/html/
10 changes: 10 additions & 0 deletions src/main/java/io/github/pixee/security/Newlines.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,14 @@ public static String stripAll(final String value) {
}
return value.replace("\r", "").replace("\n", "");
}

/**
* Removes newlines from the given string, if any exist.
*
* @param value the given string to sanitize
* @return a {@link String} identical to the one given, without newline characters
*/
public static String stripAll(final Object value) {
return stripAll(String.valueOf(value));
}
}

0 comments on commit 188d1b0

Please sign in to comment.