[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][FIX] Calendar: Display pipes, colons and less than symbols in the event title

"Adrien Mbuya Maloba \(@adrienmaloba\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68968fd562d1e_2c114857478624@gitlab-sidekiq-low-urgency-cpu-bound-v2-fc86f445f-kskxb.mail>

Adrien Mbuya Maloba pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
4c0b832d by Adrien Mbuya Maloba at 2025-08-09T02:53:29+03:00
[BP][FIX] Calendar: Display pipes, colons and less than symbols in the event title
---
* [FIX] Calendar: Display pipes, colons and less than symbols in the event title

See merge request tikiwiki/tiki!8244

- - - - -


2 changed files:

- lib/jquery_tiki/tiki-jquery.js
- src/js/jquery-tiki/tiki-calendar.js


Changes:

=====================================
lib/jquery_tiki/tiki-jquery.js
=====================================
@@ -4344,3 +4344,10 @@ function downloadBase64ImageAsFile(dataUrl, fileName = null) {
     document.body.removeChild(link);
     URL.revokeObjectURL(blobUrl);
 }
+
+// Escaping any pipes (|), colons (:) and less than symboles (<) which can be used as special characters for the tooltip
+// Use to escape characters for the event calendar tooltip
+function tooltipEscape(title) {
+    const escapedTitle = title.replace(/\|/g, "&#124;").replace(/\:/g, "&colon;").replace(/\</g, "&lt;");
+    return escapedTitle;
+}


=====================================
src/js/jquery-tiki/tiki-calendar.js
=====================================
@@ -190,7 +190,8 @@ $.fn.setupEventCalendar = function (eventCalendarParams) {
                         });
                     }
                 }
-                element.attr("title", event.title + "|" + event.extendedProps.description);
+                const eventTitle = tooltipEscape(event.title);
+                element.attr("title", eventTitle + "|" + event.extendedProps.description);
                 element.addClass("tips");
                 // surely there's a better way?
                 $(element).parent().tiki_popover();



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/4c0b832d0924405ad39cbda8c205cf565925b25a

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/4c0b832d0924405ad39cbda8c205cf565925b25a
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.