]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Bug fix: correct bug in copy (for some servers configuration)
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Mon, 16 Feb 2009 09:49:51 +0000 (09:49 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Mon, 16 Feb 2009 09:49:51 +0000 (09:49 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@275 b3834d28-1941-0410-a4f8-b48e95affb8f

bookmarks.php
services/bookmark2tagservice.php
templates/bookmarks.tpl.php

index a0f15e27c2302f4f9d8bc2533c09f294cf42cae8..43c2275b5ff4d0ee65f4610925520cbffc6a39d4 100644 (file)
@@ -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'];
index d09aee29e49dbe6307ded9674ebe9a2097f9f0d6..257db15a16f94beb4076ca396d03c4a7cc81baa1 100644 (file)
@@ -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;
                }
index f7cec7759c09d6c893ee23119f68b65715d304dd..97a37fa72c8aed578888032acd4667ea074fed47 100644 (file)
@@ -189,7 +189,7 @@ if($currenttag!= '') {
                if ($userservice->isLoggedOn()
                && ($currentUser->getId() != $row['uId'])
                && !$bookmarkservice->bookmarkExists($row['bAddress'], $currentUser->getId())) {
-                       $copy .= ' - <a href="'. createURL('bookmarks', $currentUser->getUsername() .'?action=add&amp;address='. urlencode($row['bAddress']) .'&amp;title='. urlencode($row['bTitle'])). '&amp;description='.urlencode($row['bDescription']). '&amp;tags='.$tagsForCopy  .'">'. T_('Copy') .'</a>';
+                       $copy .= ' - <a href="'. createURL('bookmarks', $currentUser->getUsername() .'?action=add&amp;copyOf='. $row['bId']) .'">'. T_('Copy') .'</a>';
                }
 
                // Nofollow option