From 31d6aaf6b451f17b15649354468cb34e1452f1d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 Aug 2021 13:06:57 +0200 Subject: [PATCH] FIX avoid to have link to create bookmar on page to create bookmark --- htdocs/bookmarks/bookmarks.lib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index 324f62d0e21..d24ba63ef55 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -107,9 +107,11 @@ function printDropdownBookmarksList() $searchForm .= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...'; // Url to go on create new bookmark page if (!empty($user->rights->bookmark->creer)) { - $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); - $searchForm .= ''; + if (!preg_match('/bookmarks\/card.php/', $_SERVER['PHP_SELF'])) { + $urltoadd = DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url); + $searchForm .= ''; + } } $i = 0; while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {