[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] ParserLib: Prevent double-encoding of ampersands in plugin output

"Bruno Kambere \(@kambereBr\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69ac08bb6f489_3b189200718dc@gitlab-sidekiq-low-urgency-cpu-bound-v2-6cd78889bf-tlq97.mail>

Bruno Kambere pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
c8434b75 by Bruno Kambere at 2026-03-07T13:07:45+02:00
[FIX] ParserLib: Prevent double-encoding of ampersands in plugin output
---
* [FIX] ParserLib: Prevent double-encoding of ampersands in plugin output

See merge request tikiwiki/tiki!9477

- - - - -


1 changed file:

- lib/parser/parserlib.php


Changes:

=====================================
lib/parser/parserlib.php
=====================================
@@ -209,7 +209,8 @@ class ParserLib extends TikiDb_Bridge
     {
         // cleaning some user input
         if (! $this->option['wysiwyg']) {
-            $data = str_replace('&', '&amp;', $data);
+            // Only encode ampersands that are not already part of an HTML entity
+            $data = preg_replace('/&(?![a-zA-Z0-9#]+;)/', '&amp;', $data);
         }
 
         // oft-used characters (case insensitive)



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

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/c8434b75d425f48ae34b348e429430aac5daa1a2
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
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.