[TikiWiki-commits] [Git][tikiwiki/tiki][28.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 <6897d4f06b03f_2c566a4e04605c@gitlab-sidekiq-low-urgency-cpu-bound-v2-fc86f445f-52vtm.mail>

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


Commits:
e576a349 by Adrien Mbuya Maloba at 2025-08-10T02:01:41+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!8253

- - - - -


2 changed files:

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


Changes:

=====================================
lib/jquery_tiki/tiki-jquery.js
=====================================
@@ -5015,3 +5015,10 @@ $.fn.toastNotification = function (options) {
         })(options.delay, currentid);
     }
 };
+
+// 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
=====================================
@@ -178,7 +178,8 @@ $.fn.setupFullCalendar = function (fullCalendarParams) {
                         });
                     }
                 }
-                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/e576a34975e0a0ebd1d1184dea5327bcae54874c

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/e576a34975e0a0ebd1d1184dea5327bcae54874c
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.