mirror of
https://github.com/processwire/processwire.git
synced 2025-08-18 04:22:10 +02:00
Move logic for wireBytesStr() function into WireNumberTools class bytesToStr() method, while also making improvements to the method. Also add a strTobytes() method that does the opposite of bytesToStr. This also incorporates the addition of terabytes support submitted in another PR from @matjazpotocnik.
This commit is contained in:
@@ -164,6 +164,12 @@ class Sanitizer extends Wire {
|
||||
*
|
||||
*/
|
||||
protected $textTools = null;
|
||||
|
||||
/**
|
||||
* @var null|WireNumberTools
|
||||
*
|
||||
*/
|
||||
protected $numberTools = null;
|
||||
|
||||
/**
|
||||
* Runtime caches
|
||||
@@ -5337,6 +5343,24 @@ class Sanitizer extends Wire {
|
||||
}
|
||||
return $this->textTools;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get instance of WireNumberTools
|
||||
*
|
||||
* #pw-group-numbers
|
||||
* #pw-group-other
|
||||
*
|
||||
* @return WireNumberTools
|
||||
* @since 3.0.214
|
||||
*
|
||||
*/
|
||||
public function getNumberTools() {
|
||||
if(!$this->numberTools) {
|
||||
$this->numberTools = new WireNumberTools();
|
||||
$this->wire($this->numberTools);
|
||||
}
|
||||
return $this->numberTools;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************
|
||||
* FILE VALIDATORS
|
||||
|
Reference in New Issue
Block a user