Bug fix: correct bug if updating a bookmark with the url of another existing bookmark.

git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@303 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
mensonge 2009-02-28 15:37:18 +00:00
parent 4386a63ec1
commit d833e18b68

View file

@ -214,6 +214,15 @@ class BookmarkService {
$moddatetime = gmdate('Y-m-d H:i:s', time()); $moddatetime = gmdate('Y-m-d H:i:s', time());
$address = $this->normalize($address);
//check if a new address ($address) doesn't already exist for another bookmark from the same user
$bookmark = $this->getBookmark($bId);
if($bookmark['bAddress'] != $address && $this->bookmarkExists($address, $bookmark['uId'])) {
message_die(GENERAL_ERROR, 'Could not update bookmark (URL already existing = '.$address.')', '', __LINE__, __FILE__);
return false;
}
// Set up the SQL update statement and execute it. // Set up the SQL update statement and execute it.
$updates = array('bModified' => $moddatetime, 'bTitle' => $title, 'bAddress' => $address, 'bDescription' => $description, 'bPrivateNote' => $privateNote, 'bStatus' => $status, 'bHash' => md5($address)); $updates = array('bModified' => $moddatetime, 'bTitle' => $title, 'bAddress' => $address, 'bDescription' => $description, 'bPrivateNote' => $privateNote, 'bStatus' => $status, 'bHash' => md5($address));