show proper error message when url is invalid

This commit is contained in:
Christian Weiske 2011-05-03 19:15:36 +02:00
parent 4a3fdcc4dd
commit c8a5f29677

View file

@ -135,8 +135,11 @@ if ($userservice->isLoggedOn() && POST_SUBMITTED != '') {
$templatename = 'editbookmark.tpl'; $templatename = 'editbookmark.tpl';
} else { } else {
$address = trim(POST_ADDRESS); $address = trim(POST_ADDRESS);
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 // If the bookmark exists already, edit the original
if ($bookmarkservice->bookmarkExists($address, $currentUserID)) {
$bookmark = $bookmarkservice->getBookmarkByAddress($address); $bookmark = $bookmarkservice->getBookmarkByAddress($address);
header('Location: '. createURL('edit', $bookmark['bId'])); header('Location: '. createURL('edit', $bookmark['bId']));
exit(); exit();