Reverting checkLink changes

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@176812 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2019-01-25 09:11:52 +00:00
parent 563e77551c
commit d0aad689dc
1 changed files with 3 additions and 5 deletions

View File

@ -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)) {