]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
show proper error message when url is invalid
authorChristian Weiske <cweiske@cweiske.de>
Tue, 3 May 2011 17:15:36 +0000 (19:15 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 3 May 2011 17:15:36 +0000 (19:15 +0200)
www/bookmarks.php

index 3b1d50afa759f882ed1b09ea4f688dc5d8f4e04e..ee0612e344af222beb858bafcf62b9241a415d8e 100644 (file)
@@ -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();