From c8a5f29677383cb607faef3e19f95a2be2e469cd Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 3 May 2011 19:15:36 +0200 Subject: show proper error message when url is invalid --- www/bookmarks.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'www') diff --git a/www/bookmarks.php b/www/bookmarks.php index 3b1d50a..ee0612e 100644 --- a/www/bookmarks.php +++ b/www/bookmarks.php @@ -135,8 +135,11 @@ if ($userservice->isLoggedOn() && POST_SUBMITTED != '') { $templatename = 'editbookmark.tpl'; } else { $address = trim(POST_ADDRESS); - // If the bookmark exists already, edit the original - if ($bookmarkservice->bookmarkExists($address, $currentUserID)) { + if (!SemanticScuttle_Model_Bookmark::isValidUrl($address)) { + $tplVars['error'] = T_('This bookmark URL may not be added'); + $templatename = 'editbookmark.tpl'; + } else if ($bookmarkservice->bookmarkExists($address, $currentUserID)) { + // If the bookmark exists already, edit the original $bookmark = $bookmarkservice->getBookmarkByAddress($address); header('Location: '. createURL('edit', $bookmark['bId'])); exit(); -- cgit v1.2.3-54-g00ecf