From 6ece5f6931c87ea30ac1778e58bb39158627f913 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Aug 2021 13:01:57 +0200 Subject: [PATCH] FIX avoid to have link to create bookmar on page to create bookmark --- htdocs/bookmarks/bookmarks.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 4c52182cff7..324f62d0e21 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -72,10 +72,12 @@ function printDropdownBookmarksList() // Url to go on create new bookmark page $newbtn = ''; if (!empty($user->rights->bookmark->creer)) { - //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); - $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); - $newbtn .= ''; - $newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; + if (!preg_match('/bookmarks\/card.php/', $_SERVER['PHP_SELF'])) { + //$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url); + $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); + $newbtn .= ''; + $newbtn .= img_picto('', 'add', '', false, 0, 0, '', 'paddingright').dol_escape_htmltag($langs->trans('AddThisPageToBookmarks')).''; + } } // Menu with list of bookmarks