[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] tabular API sync: json encoding issue

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69afe1fa6402f_3b189930729e5@gitlab-sidekiq-low-urgency-cpu-bound-v2-6df5f9ffdd-9kj67.mail>

Victor Emanouilov pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
15bd6be4 by Victor Emanouilov at 2026-03-10T11:18:36+02:00
[FIX] tabular API sync: json encoding issue

- - - - -


1 changed file:

- lib/core/Tracker/Tabular/Writer/APIWriter.php


Changes:

=====================================
lib/core/Tracker/Tabular/Writer/APIWriter.php
=====================================
@@ -272,7 +272,7 @@ class APIWriter
             $formatted_row = $format;
             if (@json_decode($format) !== null) {
                 foreach ($columns as $column) {
-                    $formatted_row = str_replace('%' . $column->getLabel() . '%', preg_replace(["/\r/", "/\n/"], ["", "\\n"], addslashes($row[$column->getLabel()])), $formatted_row);
+                    $formatted_row = str_replace('%' . $column->getLabel() . '%', substr(json_encode((string) $row[$column->getLabel()], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), 1, -1), $formatted_row);
                 }
             } else {
                 foreach ($columns as $column) {



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

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