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

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

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


Commits:
f64d7c2d by Victor Emanouilov at 2026-03-10T11:18:27+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/f64d7c2d9f5557eb8a018701084de007619158e2

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