tju-yxq opened a new pull request, #5515:
URL: https://github.com/apache/rocketmq-dashboard/pull/5515

   ### Which Issue(s) This PR Fixes
   
   - Fixes #5514
   
   ### Brief Description
   
   Aligns `CsvUtil.toCell` with the web escaper's formula-injection protection: 
values that start with one or more apostrophes followed by a formula character 
now also get the protection apostrophe, so stripping exactly one leading 
apostrophe (the web importer's rule in `resourceCsvImport.ts`) always restores 
the original value.
   
   - `needsFormulaEscape` mirrors `escapeCsvCell`'s 
`/^(?:[=+\-@\t\r\n]|'+[=+\-@\t\r\n])/` rule.
   - Plain apostrophe values without a following formula character stay 
untouched.
   - All three server exporters (topics, consumer groups, audit logs, cloud 
credentials) route through `CsvUtil.appendRow`, so the topic/group export → 
import round trip now preserves user apostrophes, and audit/credential CSVs 
carry the same protection level as frontend-produced CSVs.
   
   ### Verification
   
   - `mvn test -Dtest=CsvUtilTest` — 6/6 pass, including three new cases: 
apostrophe-prefixed formulas get the second apostrophe, plain apostrophes stay 
untouched, and a property test asserting the escaped cell survives the 
importer's single-apostrophe strip for `=SUM(A1)`, `'=SUM(A1)`, `''=SUM(A1)`, 
`'-tag`, and `+x`.
   - `mvn test 
-Dtest="MetadataServiceTest,TopicControllerTest,AuditServiceTest,CloudCredentialServiceTest"`
 — all pass; the existing export fixtures (`\t=orders`, `=formula`) use the 
direct-formula path and are unchanged.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to