Skip to content

Commit 188d1b0

Browse files
authored
Merge pull request #38 from pixee/feature/strip-all-alternative
Add another newline stripping API
2 parents 3c078f0 + a2215e1 commit 188d1b0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/badges/jacoco.svg

Lines changed: 1 addition & 1 deletion
Loading

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
git push
4545
fi
4646
- name: "Upload JaCoCo coverage report"
47-
uses: actions/upload-artifact@v2
47+
uses: actions/upload-artifact@v4
4848
with:
4949
name: jacoco-report
5050
path: build/reports/jacoco/test/html/

src/main/java/io/github/pixee/security/Newlines.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,14 @@ public static String stripAll(final String value) {
1717
}
1818
return value.replace("\r", "").replace("\n", "");
1919
}
20+
21+
/**
22+
* Removes newlines from the given string, if any exist.
23+
*
24+
* @param value the given string to sanitize
25+
* @return a {@link String} identical to the one given, without newline characters
26+
*/
27+
public static String stripAll(final Object value) {
28+
return stripAll(String.valueOf(value));
29+
}
2030
}

0 commit comments

Comments
 (0)