\Tests\UnitCsvHelperTest

CSV 公式注入防护

被测对象:CsvHelper::escapeCell 守护约定:= + - @ 与制表符、回车开头的值前置单引号(表格软件按纯文本展示); 其余值原样返回;空值与纯数字不受影响。

Summary

Methods
Properties
Constants
test_formula_prefixes_are_neutralized()
test_plain_values_unchanged()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

test_formula_prefixes_are_neutralized()

test_formula_prefixes_are_neutralized() : void

公式/DDE 前缀(= + - @ 与制表符/回车)一律前置单引号。

test_plain_values_unchanged()

test_plain_values_unchanged() : void

普通文本与空值原样返回。