add some UTF-8 validation

This commit is contained in:
Dylan K. Taylor
2019-08-01 19:51:31 +01:00
parent 399ef13069
commit 135a2f520c
5 changed files with 19 additions and 5 deletions

View File

@@ -23,6 +23,8 @@ declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\utils\Utils;
class WritableBookPage{
/** @var string */
@@ -31,7 +33,8 @@ class WritableBookPage{
private $photoName;
public function __construct(string $text, string $photoName = ""){
//TODO: data validation, encoding checks
//TODO: data validation
Utils::checkUTF8($text);
$this->text = $text;
$this->photoName = $photoName;
}