Fixing URL preview refs #13213
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@176775 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
30c8efe0b2
commit
605c9830af
|
@ -57,6 +57,7 @@ import org.gcube.portlets.user.shareupdates.shared.UserSettings;
|
||||||
import org.gcube.portlets.widgets.pickitem.shared.ItemBean;
|
import org.gcube.portlets.widgets.pickitem.shared.ItemBean;
|
||||||
import org.gcube.social_networking.socialutillibrary.MessageParser;
|
import org.gcube.social_networking.socialutillibrary.MessageParser;
|
||||||
import org.gcube.social_networking.socialutillibrary.Utils;
|
import org.gcube.social_networking.socialutillibrary.Utils;
|
||||||
|
import org.gcube.socialnetworking.token.URLToken;
|
||||||
import org.gcube.vomanagement.usermanagement.GroupManager;
|
import org.gcube.vomanagement.usermanagement.GroupManager;
|
||||||
import org.gcube.vomanagement.usermanagement.RoleManager;
|
import org.gcube.vomanagement.usermanagement.RoleManager;
|
||||||
import org.gcube.vomanagement.usermanagement.UserManager;
|
import org.gcube.vomanagement.usermanagement.UserManager;
|
||||||
|
@ -730,9 +731,11 @@ public class ShareUpdateServiceImpl extends RemoteServiceServlet implements Shar
|
||||||
LinkPreview toReturn = null;
|
LinkPreview toReturn = null;
|
||||||
_log.info("to check " + linkToCheck);
|
_log.info("to check " + linkToCheck);
|
||||||
//look for a url in text
|
//look for a url in text
|
||||||
linkToCheck = Utils.extractURL(linkToCheck);
|
URL url = URLToken.isURL(linkToCheck);
|
||||||
if (linkToCheck == null)
|
if (url == null) {
|
||||||
return null; //no url
|
return null; //no url
|
||||||
|
}
|
||||||
|
linkToCheck = url.toString();
|
||||||
|
|
||||||
String[] schemes = {"http","https"};
|
String[] schemes = {"http","https"};
|
||||||
UrlValidator urlValidator = new UrlValidator(schemes);
|
UrlValidator urlValidator = new UrlValidator(schemes);
|
||||||
|
|
Loading…
Reference in New Issue