1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-01-21 17:52:10 +01:00

Improve protocols regex

This commit is contained in:
TtuxX 2015-03-09 20:31:38 +01:00
parent bc1b9daa1d
commit e85ecbed55

View File

@ -70,7 +70,7 @@ class BookmarkController extends ApiController {
if ($from_own == 0) {
// allow only http(s) and (s)ftp
$protocols = '/^[hs]{0,1}[tf]{0,1}tp[s]{0,1}\:\/\//i';
$protocols = '/^(https?|s?ftp)\:\/\//i';
if (preg_match($protocols, $url)) {
$datas = Bookmarks::getURLMetadata($url);
// if not (allowed) protocol is given, assume http and https (and fetch both)