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

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

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
e6cfd73c by Victor Emanouilov at 2026-03-10T11:18:16+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/e6cfd73c8c79af85deac5767e528f028f72c7515

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