diff options
author | Christian Weiske <cweiske@cweiske.de> | 2011-05-03 19:15:36 +0200 |
---|---|---|
committer | Christian Weiske <cweiske@cweiske.de> | 2011-05-03 19:15:36 +0200 |
commit | c8a5f29677383cb607faef3e19f95a2be2e469cd (patch) | |
tree | 59dbbc9df86d61c62efb7fa0dea8cb1d0570757c /www | |
parent | 4a3fdcc4dd5e1298ec701817ae7041e9992a8ff8 (diff) | |
download | semanticscuttle-c8a5f29677383cb607faef3e19f95a2be2e469cd.tar.gz semanticscuttle-c8a5f29677383cb607faef3e19f95a2be2e469cd.tar.bz2 |
show proper error message when url is invalid
Diffstat (limited to 'www')
-rw-r--r-- | www/bookmarks.php | 7 |
1 files changed, 5 insertions, 2 deletions
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(); |