aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/front/controller/visitor
diff options
context:
space:
mode:
Diffstat (limited to 'application/front/controller/visitor')
-rw-r--r--application/front/controller/visitor/BookmarkListController.php7
-rw-r--r--application/front/controller/visitor/TagCloudController.php12
2 files changed, 14 insertions, 5 deletions
diff --git a/application/front/controller/visitor/BookmarkListController.php b/application/front/controller/visitor/BookmarkListController.php
index 2988bee6..18368751 100644
--- a/application/front/controller/visitor/BookmarkListController.php
+++ b/application/front/controller/visitor/BookmarkListController.php
@@ -34,7 +34,7 @@ class BookmarkListController extends ShaarliVisitorController
34 $formatter = $this->container->formatterFactory->getFormatter(); 34 $formatter = $this->container->formatterFactory->getFormatter();
35 $formatter->addContextData('base_path', $this->container->basePath); 35 $formatter->addContextData('base_path', $this->container->basePath);
36 36
37 $searchTags = escape(normalize_spaces($request->getParam('searchtags') ?? '')); 37 $searchTags = normalize_spaces($request->getParam('searchtags') ?? '');
38 $searchTerm = escape(normalize_spaces($request->getParam('searchterm') ?? ''));; 38 $searchTerm = escape(normalize_spaces($request->getParam('searchterm') ?? ''));;
39 39
40 // Filter bookmarks according search parameters. 40 // Filter bookmarks according search parameters.
@@ -104,8 +104,9 @@ class BookmarkListController extends ShaarliVisitorController
104 'page_current' => $page, 104 'page_current' => $page,
105 'page_max' => $pageCount, 105 'page_max' => $pageCount,
106 'result_count' => count($linksToDisplay), 106 'result_count' => count($linksToDisplay),
107 'search_term' => $searchTerm, 107 'search_term' => escape($searchTerm),
108 'search_tags' => $searchTags, 108 'search_tags' => escape($searchTags),
109 'search_tags_url' => array_map('urlencode', explode(' ', $searchTags)),
109 'visibility' => $visibility, 110 'visibility' => $visibility,
110 'links' => $linkDisp, 111 'links' => $linkDisp,
111 ] 112 ]
diff --git a/application/front/controller/visitor/TagCloudController.php b/application/front/controller/visitor/TagCloudController.php
index f9c529bc..76ed7690 100644
--- a/application/front/controller/visitor/TagCloudController.php
+++ b/application/front/controller/visitor/TagCloudController.php
@@ -66,10 +66,18 @@ class TagCloudController extends ShaarliVisitorController
66 $tags = $this->formatTagsForCloud($tags); 66 $tags = $this->formatTagsForCloud($tags);
67 } 67 }
68 68
69 $tagsUrl = [];
70 foreach ($tags as $tag => $value) {
71 $tagsUrl[escape($tag)] = urlencode((string) $tag);
72 }
73
69 $searchTags = implode(' ', escape($filteringTags)); 74 $searchTags = implode(' ', escape($filteringTags));
75 $searchTagsUrl = urlencode(implode(' ', $filteringTags));
70 $data = [ 76 $data = [
71 'search_tags' => $searchTags, 77 'search_tags' => escape($searchTags),
72 'tags' => $tags, 78 'search_tags_url' => $searchTagsUrl,
79 'tags' => escape($tags),
80 'tags_url' => $tagsUrl,
73 ]; 81 ];
74 $this->executePageHooks('render_tag' . $type, $data, 'tag.' . $type); 82 $this->executePageHooks('render_tag' . $type, $data, 'tag.' . $type);
75 $this->assignAllView($data); 83 $this->assignAllView($data);