summaryrefslogtreecommitdiff
path: root/www/bookmarks.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-03 19:15:36 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-03 19:15:36 +0200
commitc8a5f29677383cb607faef3e19f95a2be2e469cd (patch)
tree59dbbc9df86d61c62efb7fa0dea8cb1d0570757c /www/bookmarks.php
parent4a3fdcc4dd5e1298ec701817ae7041e9992a8ff8 (diff)
downloadsemanticscuttle-c8a5f29677383cb607faef3e19f95a2be2e469cd.tar.gz
semanticscuttle-c8a5f29677383cb607faef3e19f95a2be2e469cd.tar.bz2
show proper error message when url is invalid
Diffstat (limited to 'www/bookmarks.php')
-rw-r--r--www/bookmarks.php7
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();