Skip to content

Commit

Permalink
SAK-43504 Rwiki: Deprecated utils.FormattedText => api.FormattedText (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
axxter99 authored May 5, 2020
1 parent 0a20eeb commit 415d1fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

import lombok.extern.slf4j.Slf4j;
import org.apache.velocity.app.event.ReferenceInsertionEventHandler;
import org.sakaiproject.util.Web;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.util.api.FormattedText;

/**
* @author ieb
Expand All @@ -53,11 +54,11 @@ public Object referenceInsert(String name, Object value)
if ( ignore .get(name) != null || name.contains("rlb.") ||
name.contains("util.escapeHtml") ||
name.contains("resourceLoaderBean.getString")) {
log.warn("Ignoring "+name);
log.warn("Ignoring {}", name);
return value;
} else {
log.warn("Escaping "+name);
return Web.escapeHtml(String.valueOf(value));
log.warn("Escaping {}", name);
return ComponentManager.get(FormattedText.class).escapeHtml(String.valueOf(value));
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package uk.ac.cam.caret.sakai.rwiki.tool;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Properties;

Expand All @@ -34,16 +33,15 @@
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.exception.MethodInvocationException;
import org.sakaiproject.util.FormattedText;
import org.sakaiproject.util.ResourceLoader;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.time.cover.TimeService;

//import org.sakaiproject.util.FormattedText;
import org.sakaiproject.util.ResourceLoader;
import org.sakaiproject.util.api.FormattedText;
import org.sakaiproject.velocity.util.SLF4JLogChute;

import uk.ac.cam.caret.sakai.rwiki.service.exception.PermissionException;
import uk.ac.cam.caret.sakai.rwiki.service.exception.ReadPermissionException;
import uk.ac.cam.caret.sakai.rwiki.tool.bean.ResourceLoaderBean;
import uk.ac.cam.caret.sakai.rwiki.tool.bean.ViewBean;
import uk.ac.cam.caret.sakai.rwiki.tool.bean.helper.ResourceLoaderHelperBean;
import uk.ac.cam.caret.sakai.rwiki.tool.command.Dispatcher;
import uk.ac.cam.caret.sakai.rwiki.utils.UserDisplayHelper;

Expand Down Expand Up @@ -146,7 +144,7 @@ public class VelocityUtilBean

public String escapeHtml(String val)
{
return FormattedText.escapeHtml(val, false);
return ComponentManager.get(FormattedText.class).escapeHtml(val, false);
}

public String formatDisplayName(String name)
Expand Down

0 comments on commit 415d1fb

Please sign in to comment.