[TikiWiki-commits] [Git][tikiwiki/tiki][29.x] [BP][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 <69ac108db3ac3_3b53d748950b2@gitlab-sidekiq-low-urgency-cpu-bound-v2-6cd78889bf-r8nn4.mail>

Bruno Kambere pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
09ae16f0 by Bruno Kambere at 2026-03-07T13:40:55+02:00
[BP][FIX] ParserLib: Prevent double-encoding of ampersands in plugin output
---
* [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

See merge request tikiwiki/tiki!9709

- - - - -


1 changed file:

- lib/parser/parserlib.php


Changes:

=====================================
lib/parser/parserlib.php
=====================================
@@ -129,7 +129,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/09ae16f093c65714c779ac53267538c4a01bcdd0

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