From a15fd27e8adc18367d358c06e39343e0c34ed1e0 Mon Sep 17 00:00:00 2001 From: mensonge Date: Mon, 16 Feb 2009 09:49:51 +0000 Subject: Bug fix: correct bug in copy (for some servers configuration) git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@275 b3834d28-1941-0410-a4f8-b48e95affb8f --- bookmarks.php | 15 ++++++--------- services/bookmark2tagservice.php | 2 +- templates/bookmarks.tpl.php | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/bookmarks.php b/bookmarks.php index a0f15e2..43c2275 100644 --- a/bookmarks.php +++ b/bookmarks.php @@ -34,6 +34,7 @@ isset($_GET['address']) ? define('GET_ADDRESS', $_GET['address']): define('GET_A isset($_GET['description']) ? define('GET_DESCRIPTION', $_GET['description']): define('GET_DESCRIPTION', ''); isset($_GET['privateNote']) ? define('GET_PRIVATENOTE', $_GET['privateNote']): define('GET_PRIVATENOTE', ''); isset($_GET['tags']) ? define('GET_TAGS', $_GET['tags']): define('GET_TAGS', ''); +isset($_GET['copyOf']) ? define('GET_COPYOF', $_GET['copyOf']): define('GET_COPYOF', ''); isset($_POST['title']) ? define('POST_TITLE', $_POST['title']): define('POST_TITLE', ''); isset($_POST['address']) ? define('POST_ADDRESS', $_POST['address']): define('POST_ADDRESS', ''); @@ -183,15 +184,11 @@ if ($templatename == 'editbookmark.tpl') { 'bStatus' => 0, ); $tplVars['tags'] = POST_TAGS; - } else { - $tplVars['row'] = array( - 'bTitle' => stripslashes(GET_TITLE), - 'bAddress' => stripslashes(GET_ADDRESS), - 'bDescription' => stripslashes(GET_DESCRIPTION), - 'bPrivateNote' => stripslashes(GET_PRIVATENOTE), - 'tags' => (GET_TAGS ? explode(',', stripslashes(GET_TAGS)) : array()), - 'bStatus' => 0 - ); + } else { + $tplVars['row'] = $bookmarkservice->getBookmark($_GET['copyOf'], true); + if(!$currentUser->isAdmin()) { + $tplVars['row']['bPrivateNote'] = ''; //only admin can copy private note + } } $title = T_('Add a Bookmark'); $tplVars['referrer'] = $_SERVER['HTTP_REFERER']; diff --git a/services/bookmark2tagservice.php b/services/bookmark2tagservice.php index d09aee2..257db15 100644 --- a/services/bookmark2tagservice.php +++ b/services/bookmark2tagservice.php @@ -203,7 +203,7 @@ class Bookmark2TagService { } function &getTagsForBookmark($bookmarkid) { - if (!is_int($bookmarkid)) { + if (!is_numeric($bookmarkid)) { message_die(GENERAL_ERROR, 'Could not get tags (invalid bookmarkid)', '', __LINE__, __FILE__, $query); return false; } diff --git a/templates/bookmarks.tpl.php b/templates/bookmarks.tpl.php index f7cec77..97a37fa 100644 --- a/templates/bookmarks.tpl.php +++ b/templates/bookmarks.tpl.php @@ -189,7 +189,7 @@ if($currenttag!= '') { if ($userservice->isLoggedOn() && ($currentUser->getId() != $row['uId']) && !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())) { - $copy .= ' - '. T_('Copy') .''; + $copy .= ' - '. T_('Copy') .''; } // Nofollow option -- cgit v1.2.3