[Pkg-owncloud-commits] [owncloud] 05/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 8eef7919c1c65e16255f615b217f4ac8db2340af
Author: Lukas Reschke <lukas at statuscode.ch>
Date:   Tue Apr 30 21:09:06 2013 +0300

    Check if URL is valid
---
 apps/bookmarks/ajax/editBookmark.php |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php
index 36258f7..5521aab 100644
--- a/apps/bookmarks/ajax/editBookmark.php
+++ b/apps/bookmarks/ajax/editBookmark.php
@@ -31,6 +31,12 @@ 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();
+}
+
 $CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
 if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
 	$_ut = "strftime('%s','now')";

-- 
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