Commit 667caa46 authored by Richard Bruskiewich's avatar Richard Bruskiewich Committed by Matija Obreza
Browse files

Applying a little local htmlSanitizer to this Module

more cropService htmlsanitization?

Partially remove htmlsanitation as not required
parent a197e0fa
......@@ -34,6 +34,7 @@ import org.genesys2.server.persistence.domain.CropRuleRepository;
import org.genesys2.server.persistence.domain.CropTaxonomyRepository;
import org.genesys2.server.persistence.domain.TaxonomyRepository;
import org.genesys2.server.service.CropService;
import org.genesys2.server.service.HtmlSanitizer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
......@@ -60,6 +61,9 @@ public class CropServiceImpl implements CropService {
@Autowired
TaxonomyRepository taxonomyRepository;
@Autowired
private HtmlSanitizer htmlSanitizer;
@Override
public Crop getCrop(String shortName) {
return cropRepository.findByShortName(shortName);
......@@ -212,7 +216,7 @@ public class CropServiceImpl implements CropService {
crop.setShortName(shortName);
crop.setName(name);
crop.setDescription(StringUtils.defaultIfBlank(description, null));
crop.setDescription(StringUtils.defaultIfBlank(htmlSanitizer.sanitize(description), null));
crop.setI18n(StringUtils.defaultIfBlank(i18n, null));
cropRepository.save(crop);
LOG.info("Registered crop: " + crop);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment