Add new functions: get IPs, strip UTF8 BOM from text, text updates
Add the following new static methods Convert\Strings::stripUTF8BomBytes: removes the UTF8 BOM bytes from the beginning of a line Used for CSV files created in Excel for the first header entry (line 0/row 0) Get\Systen::getIpAddresses: gets all IP addresses for the the current access user and returns an array Moved the frontend folder detection from the first load config to the config.path.php Cleaned up the translations JS scripts
This commit is contained in:
@@ -134,6 +134,18 @@ class Strings
|
||||
$path
|
||||
) ?? $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove UTF8 BOM Byte string from line
|
||||
* Note: this is often found in CSV files exported from Excel at the first row, first element
|
||||
*
|
||||
* @param string $text
|
||||
* @return string
|
||||
*/
|
||||
public static function stripUTF8BomBytes(string $text): string
|
||||
{
|
||||
return trim($text, pack('H*', 'EFBBBF'));
|
||||
}
|
||||
}
|
||||
|
||||
// __END__
|
||||
|
||||
Reference in New Issue
Block a user