mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-29 12:35:19 +00:00
${h.breakableString(…)} might be called with a null argument if something is broken.
For robustness, pass on the null to Jelly rather than failing page rendering.
This commit is contained in:
1 parent
87e66570b8
commit
3f2958795c
2 files changed
+5
-2
No files matched your search
@@ -1828,7 +1828,9 @@ public class Functions {
|
||||
* @since 1.517
|
||||
*/
|
||||
public static String breakableString(final String plain) {
|
||||
|
||||
if (plain == null) {
|
||||
return null;
|
||||
}
|
||||
return plain.replaceAll("([\\p{Punct}&&[^;]]+\\w)", "<wbr>$1")
|
||||
.replaceAll("([^\\p{Punct}\\s-]{20})(?=[^\\p{Punct}\\s-]{10})", "$1<wbr>")
|
||||
;
|
||||
|
||||
Reference in new issue
Block a user