From: Christian Weiske Date: Tue, 3 May 2011 17:15:36 +0000 (+0200) Subject: show proper error message when url is invalid X-Git-Tag: v0.98.0~70 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=c8a5f29677383cb607faef3e19f95a2be2e469cd;p=semanticscuttle.git show proper error message when url is invalid --- 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();