1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-02-19 16:54:27 +01:00

Check if URL is valid

This commit is contained in:
Lukas Reschke 2013-04-30 21:01:53 +03:00
parent d7730944ca
commit 63d1fc7b5e

View File

@ -27,6 +27,12 @@ OCP\JSON::callCheck();
OCP\JSON::checkAppEnabled('bookmarks');
// Check if it is a valid URL
if (filter_var($_POST['url'], FILTER_VALIDATE_URL) === FALSE) {
OC_JSON::error();
exit();
}
// If we go the dialog form submit
if(isset($_POST['url'])) {
$title = isset($_POST['title']) ? $_POST['title'] : '';