HEX
Server: LiteSpeed
System: Linux cp4.porkbun.com 5.14.0-611.20.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jan 14 06:35:04 EST 2026 x86_64
User: vxblllubpkafjsjw (1110)
PHP: 8.4.19
Disabled: NONE
Upload Files
File: /data0/brighttherapyllc.com/public_html/wp-content/plugins/wpforms/src/Pro/Helpers/CSV.php
<?php

namespace WPForms\Pro\Helpers;

/**
 * CSV related helper methods.
 *
 * @since 1.7.7
 */
class CSV {

	/**
	 * Formulas start characters.
	 *
	 * @since 1.7.7
	 *
	 * @var array
	 */
	const FORMULAS_START_CHARS = [ '=', '-', '+', '@', "\t", "\r" ];

	/**
	 * Escape string for CSV.
	 *
	 * @since 1.7.7
	 *
	 * @param mixed $value Value to escape.
	 *
	 * @return string
	 */
	public function escape_value( $value ) {

		// Prevent formulas in spreadsheet applications.
		if ( in_array( substr( (string) $value, 0, 1 ), self::FORMULAS_START_CHARS, true ) ) {
			$value = "'" . $value;
		}

		return html_entity_decode( $value, ENT_QUOTES );
	}
}