Skip to content

Commit

Permalink
MID-8991: replace '\r\n' with '\n' in code of script inserted by GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Sep 21, 2023
1 parent d896474 commit 77f132f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.evolveum.midpoint.web.util.ExpressionUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.ajax.AjaxRequestTarget;
Expand Down Expand Up @@ -207,6 +208,9 @@ public ScriptExpressionEvaluatorType toEvaluator() {
}

public ScriptExpressionWrapper code(String code) {
if (StringUtils.isNotEmpty(code)) {
code = code.replaceAll("(\r\n)", "\n");
}
this.code = code;
return ScriptExpressionPanel.ScriptExpressionWrapper.this;
}
Expand Down

0 comments on commit 77f132f

Please sign in to comment.