From d0aad689dc1f1ac2d92673972c3cf645faef72cb Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 25 Jan 2019 09:11:52 +0000 Subject: [PATCH] Reverting checkLink changes git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@176812 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/shareupdates/server/ShareUpdateServiceImpl.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/shareupdates/server/ShareUpdateServiceImpl.java b/src/main/java/org/gcube/portlets/user/shareupdates/server/ShareUpdateServiceImpl.java index b262cec..5e52a03 100644 --- a/src/main/java/org/gcube/portlets/user/shareupdates/server/ShareUpdateServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/shareupdates/server/ShareUpdateServiceImpl.java @@ -731,12 +731,10 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar LinkPreview toReturn = null; _log.info("to check " + linkToCheck); //look for a url in text - URL url = URLToken.isURL(linkToCheck); - if (url == null) { + linkToCheck = Utils.extractURL(linkToCheck); + if (linkToCheck == null) return null; //no url - } - linkToCheck = url.toString(); - + String[] schemes = {"http","https"}; UrlValidator urlValidator = new UrlValidator(schemes); if (! urlValidator.isValid(linkToCheck)) {