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

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\utils\Utils;
class WrittenBook extends WritableBookBase{
@@ -92,6 +93,7 @@ class WrittenBook extends WritableBookBase{
* @return $this
*/
public function setAuthor(string $authorName) : self{
Utils::checkUTF8($authorName);
$this->author = $authorName;
return $this;
}
@@ -113,6 +115,7 @@ class WrittenBook extends WritableBookBase{
* @return $this
*/
public function setTitle(string $title) : self{
Utils::checkUTF8($title);
$this->title = $title;
return $this;
}