diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..09a9d706 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,23 @@ +# This workflow will build a Java project with Maven +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven + +name: Java CI with Maven + +on: + pull_request: + +jobs: + maven-build: + runs-on: ubuntu-22.04 + steps: + - name: Git Checkout + uses: actions/checkout@v4 + - name: JDK 11 + uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: 'temurin' + - name: Build with Maven + env: + MAVEN_OPTS: -Djava.awt.headless=true -Dorg.slf4j.simpleLogger.defaultLogLevel=info -Dmaven.wagon.http.retryHandler.count=2 -Dmaven.wagon.http.pool=true + run: mvn clean install -Psnapshots -V -B diff --git a/api/pom.xml b/api/pom.xml index 79444a9c..d53dd469 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -35,10 +35,6 @@ org.sakaiproject.search search-api - - commons-lang - commons-lang - org.projectlombok lombok diff --git a/api/src/java/org/sakaiproject/clog/api/datamodel/Comment.java b/api/src/java/org/sakaiproject/clog/api/datamodel/Comment.java index 71859876..5fe45998 100644 --- a/api/src/java/org/sakaiproject/clog/api/datamodel/Comment.java +++ b/api/src/java/org/sakaiproject/clog/api/datamodel/Comment.java @@ -20,7 +20,6 @@ import java.util.Date; import java.util.Stack; -import org.apache.commons.lang.StringEscapeUtils; import org.sakaiproject.clog.api.ClogManager; import org.sakaiproject.clog.api.cover.SakaiProxy; import org.sakaiproject.entity.api.Entity; @@ -68,8 +67,7 @@ public void setContent(String text, boolean modified) { if (!this.content.equals(text) && modified) { modifiedDate = new Date().getTime(); } - - this.content = StringEscapeUtils.unescapeHtml(text.trim()); + this.content = text; } public String getContent() { diff --git a/impl/pom.xml b/impl/pom.xml index 454767bb..3778194f 100644 --- a/impl/pom.xml +++ b/impl/pom.xml @@ -51,10 +51,6 @@ org.springframework spring-beans - - commons-lang - commons-lang - junit junit diff --git a/pom.xml b/pom.xml index b9044758..5a04aeaf 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,6 @@ org.sakaiproject master 23-SNAPSHOT - ../master/pom.xml CLOG @@ -44,5 +43,30 @@ + + + + snapshots + + false + + snapshots + + + + + sonatype-nexus-snapshots + Sonatype Nexus Snapshots + https://oss.sonatype.org/content/repositories/snapshots + + false + + + true + + + + + diff --git a/tool/pom.xml b/tool/pom.xml index 6b70e8b0..9c9223c7 100644 --- a/tool/pom.xml +++ b/tool/pom.xml @@ -56,22 +56,23 @@ javax.servlet-api - commons-lang - commons-lang + org.apache.commons + commons-lang3 org.projectlombok lombok - javax.servlet - jstl + jakarta.servlet.jsp.jstl + jakarta.servlet.jsp.jstl-api + ${sakai.jakarta.jstl-api.version} compile - taglibs - standard - 1.1.2 + org.apache.taglibs + taglibs-standard-impl + 1.2.5 compile diff --git a/tool/src/java/org/sakaiproject/clog/tool/ClogTool.java b/tool/src/java/org/sakaiproject/clog/tool/ClogTool.java index b04e906b..f0d4c768 100644 --- a/tool/src/java/org/sakaiproject/clog/tool/ClogTool.java +++ b/tool/src/java/org/sakaiproject/clog/tool/ClogTool.java @@ -9,7 +9,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.sakaiproject.clog.api.ClogManager; import org.sakaiproject.clog.api.SakaiProxy; import org.sakaiproject.component.api.ComponentManager; @@ -107,7 +107,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t request.setAttribute("sakaiHtmlHead", (String) request.getAttribute("sakai.html.head")); request.setAttribute("userId", userId); - request.setAttribute("userDisplayName", StringEscapeUtils.escapeJavaScript(displayName)); + request.setAttribute("userDisplayName", StringEscapeUtils.escapeEcmaScript(displayName)); request.setAttribute("siteId", siteId); request.setAttribute("state", state); diff --git a/tool/src/webapp/WEB-INF/functions.tld b/tool/src/webapp/WEB-INF/functions.tld index f730b583..40c4c944 100644 --- a/tool/src/webapp/WEB-INF/functions.tld +++ b/tool/src/webapp/WEB-INF/functions.tld @@ -28,9 +28,7 @@ escapeJS - - - org.apache.commons.lang.StringEscapeUtils - java.lang.String escapeJavaScript(java.lang.String) + org.apache.commons.lang3.StringEscapeUtils + java.lang.String escapeEcmaScript(java.lang.String)