FOSSology  4.7.1
Open Source License Compliance by Open Source Software
Fossology\Lib\Application\CustomTextEscaping Class Reference

Escape/unescape newlines for single-line CSV fields. More...

Collaboration diagram for Fossology\Lib\Application\CustomTextEscaping:
Collaboration graph

Static Public Member Functions

static escapeNewlines ($value)
 Flatten real newlines to a literal
so a field stays on one physical CSV line. Backslashes are escaped first so unescapeNewlines() can reverse the transform exactly, even if the text itself already contains a literal backslash-n sequence. More...
 
static unescapeNewlines ($value)
 Reverse escapeNewlines(): literal
becomes a real newline, any other escaped character is unescaped to itself. More...
 

Detailed Description

Escape/unescape newlines for single-line CSV fields.

Definition at line 19 of file CustomTextEscaping.php.

Member Function Documentation

◆ escapeNewlines()

static Fossology\Lib\Application\CustomTextEscaping::escapeNewlines (   $value)
static

Flatten real newlines to a literal
so a field stays on one physical CSV line. Backslashes are escaped first so unescapeNewlines() can reverse the transform exactly, even if the text itself already contains a literal backslash-n sequence.

Parameters
string | null$value
Returns
string

Definition at line 29 of file CustomTextEscaping.php.

◆ unescapeNewlines()

static Fossology\Lib\Application\CustomTextEscaping::unescapeNewlines (   $value)
static

Reverse escapeNewlines(): literal
becomes a real newline, any other escaped character is unescaped to itself.

Parameters
string | null$value
Returns
string

Definition at line 44 of file CustomTextEscaping.php.


The documentation for this class was generated from the following file: