[Pkg-owncloud-commits] [owncloud] 04/07: Check if URL is valid

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:09:54 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v4.0.15
in repository owncloud.

commit ac4230100af0da8bd69b6d7ba76ee1f1e00abdce
Author: Lukas Reschke <lukas at statuscode.ch>
Date:   Tue Apr 30 21:08:47 2013 +0300

    Check if URL is valid
---
 apps/bookmarks/ajax/addBookmark.php |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php
index b4d0f33..187cfe4 100644
--- a/apps/bookmarks/ajax/addBookmark.php
+++ b/apps/bookmarks/ajax/addBookmark.php
@@ -31,6 +31,13 @@ OCP\JSON::checkLoggedIn();
 OCP\JSON::checkAppEnabled('bookmarks');
 OCP\JSON::callCheck();
 
+// Check if it is a valid URL
+if (filter_var($_POST['url'], FILTER_VALIDATE_URL) === FALSE) {
+ OC_JSON::error();
+	exit();
+}
+
+
 require_once(OC::$APPSROOT . '/apps/bookmarks/bookmarksHelper.php');
 $id = addBookmark($_POST['url'], $_POST['title'], $_POST['tags']);
-OCP\JSON::success(array('data' => $id));
\ No newline at end of file
+OCP\JSON::success(array('data' => $id));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list